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.

41 lines
1.0 KiB

4 months ago
1 month ago
1 month ago
4 months ago
4 months ago
1 month ago
4 months ago
1 month ago
4 months ago
1 month ago
1 month ago
4 months ago
4 months ago
4 months ago
1 month ago
1 month ago
1 month ago
  1. HUGO ?= hugo
  2. DEV_SERVE ?= serve --buildDrafts --buildFuture --buildExpired
  3. NETLIFY_DEPLOY ?= deploy -d public
  4. LOCAL_IP ?= $(shell ip a | grep -oP '192\.168\.\d+\.\d+/' | head -n 1 | tr -d '/')
  5. .PHONY: all
  6. all: build
  7. .PHONY: build
  8. build: static/font.css static/styles.css ; @${HUGO}
  9. .PHONY: public
  10. public: build
  11. .PHONY: dev
  12. dev:
  13. @stylus -w src/stylus/styles.styl --sourcemap -o static/styles.css &
  14. @${HUGO} ${DEV_SERVE}
  15. .PHONY: dev-ext
  16. dev-ext:
  17. @stylus -w src/stylus/styles.styl --sourcemap -o static/styles.css &
  18. @${HUGO} ${DEV_SERVE} --bind ${LOCAL_IP} --baseURL ${LOCAL_IP}
  19. .PHONY: clean
  20. clean: ; @rm -r public
  21. .PHONY: publish
  22. publish: clean-css public ; @netlify ${NETLIFY_DEPLOY} && echo "Run \`make publish-prod\` when ready."
  23. .PHONY: publish-prod
  24. publish-prod: clean-css public ; @netlify ${NETLIFY_DEPLOY} --prod
  25. static/font.css: src/stylus/font.styl
  26. stylus --compress $< -o $@
  27. static/styles.css: src/stylus/styles.styl $(shell find src/stylus -regex ".*\.styl")
  28. stylus --compress $< -o $@
  29. .PHONY: clean-css
  30. clean-css: ; rm -f static/styles.css