You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1023 B

HUGO ?= hugo
DEV_SERVE ?= serve --buildDrafts --buildFuture --buildExpired
NETLIFY_DEPLOY ?= deploy -d public
.PHONY: all
all: build
.PHONY: build
build: static/font.css static/styles.css ; @${HUGO}
.PHONY: public
public: build
.PHONY: dev
@stylus -w src/stylus/styles.styl --sourcemap -o static/styles.css &
.PHONY: dev-ext
@stylus -w src/stylus/styles.styl --sourcemap -o static/styles.css &
@${HUGO} ${DEV_SERVE} --bind $(shell ip a | grep -oP '192\.168\.\d+\.\d+/' | head -n 1 | tr -d '/')
.PHONY: clean
clean: ; @rm -r public
.PHONY: publish
publish: clean-css public ; @netlify ${NETLIFY_DEPLOY} && echo "Run \`make publish-prod\` when ready."
.PHONY: publish-prod
publish-prod: clean-css public ; @netlify ${NETLIFY_DEPLOY} --prod
static/font.css: src/stylus/font.styl
stylus --compress $< -o $@
static/styles.css: src/stylus/styles.styl $(shell find src/stylus -regex ".*\.styl")
stylus --compress $< -o $@
.PHONY: clean-css
clean-css: ; rm -f static/styles.css