site.lyte.dev/makefile

36 lines
862 B
Makefile

HUGO ?= hugo
DEV_SERVE ?= serve --buildDrafts --buildFuture --buildExpired
NETLIFY_DEPLOY ?= deploy -d public
.PHONY: all
all: build
.PHONY: build
build: themes/lyte/static/styles.css ; @${HUGO}
.PHONY: public
public: build
.PHONY: dev
dev:
@stylus -w themes/lyte/styles.styl --sourcemap -o themes/lyte/static/styles.css &
@${HUGO} ${DEV_SERVE}
.PHONY: dev-ext
dev-ext: ; @${HUGO} ${DEV_SERVE} --bind 0.0.0.0
.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
themes/lyte/static/styles.css: themes/lyte/styles.styl $(shell find ./themes/lyte -regex ".*\.styl")
stylus --compress $< -o $@
.PHONY: clean-css
clean-css: ; rm -f themes/lyte/static/styles.css