diff options
-rw-r--r-- | Makefile | 117 | ||||
-rw-r--r-- | shell.nix | 1 |
2 files changed, 61 insertions, 57 deletions
@@ -1,71 +1,34 @@ -all: - make config - make js - make hugo +help: # Show this help menu + @printf "\n%s\n\n" "$$(grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | column -s ':#' -t)" -config: +watch: # Watch and rebuild everything + while true; do find . | entr -d -s 'make build'; done + +monitor: # Monitor for files changes + inotifywait --monitor --recursive --event modify . + +server: # Start server + caddy file-server --listen :9294 --root public + +build: # Build everything + make build-config + make build-js + make build-site + +build-config: # Build configuration files yj -yj -i < config.yaml > config.json yj -yt -i < config.yaml > config.toml -watch: - while true; do find . | entr -d -s 'make all'; done - -js: +build-js: # Build js bundle deno run --allow-all static/js/bundle.ts -hugo: +build-site: # Build site rm -rf public hugo --logLevel debug --templateMetrics --templateMetricsHints hugo --logLevel debug --templateMetrics --templateMetricsHints rm -f .hugo_build.lock -monitor: - inotifywait --monitor --recursive --event modify . - -server: - caddy file-server --listen :9294 --root public - -test: - make test-html - make test-xsl - make test-xml - make test-rss - make test-jsonfeed - -test-html: - vnu \ - --html \ - --errors-only \ - public/index.html \ - public/default/index.html - -test-css: - vnu \ - --css \ - assets/css/default.css \ - assets/css/syntax-highlight-default.css - -test-xsl: - xsltproc public/rss.xsl - xsltproc public/sitemap.xsl - -test-xml: - xmllint --noout \ - public/rss.xml \ - public/sitemap.xml - -test-rss: - xmllint --noout --relaxng assets/schemas/rss-v2.0.rng public/rss.xml -# xmllint --noout --schema assets/schemas/rss-v2.0.xsd public/rss.xml - -test-sitemap: - xmllint --noout --schema assets/schemas/sitemap-v0.9.xsd public/sitemap.xml -# xmllint --noout --schema assets/schemas/sitemapindex-v0.9.xsd public/sitemap.xml - -test-jsonfeed: - check-jsonschema --schemafile assets/schemas/jsonfeed-v1.1.json public/index.json - -icons: +build-icons: # Build icons rm -rf static/icons mkdir -p static/icons/feather static/icons/tabler curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/LICENSE --output-dir static/icons/feather @@ -106,3 +69,43 @@ icons: curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/robot.svg --output-dir static/icons/tabler curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/square-letter-m.svg --output-dir static/icons/tabler git add -f static/icons + +test: # Test everything + make test-html + make test-xsl + make test-xml + make test-rss + make test-jsonfeed + +test-html: # Test HTML + vnu \ + --html \ + --errors-only \ + public/index.html \ + public/default/index.html + +test-css: # Test CSS + vnu \ + --css \ + assets/css/default.css \ + assets/css/syntax-highlight-default.css + +test-xsl: # Test XSL + xsltproc public/rss.xsl + xsltproc public/sitemap.xsl + +test-xml: # Test XML + xmllint --noout \ + public/rss.xml \ + public/sitemap.xml + +test-rss: # Test RSS + xmllint --noout --relaxng assets/schemas/rss-v2.0.rng public/rss.xml +# xmllint --noout --schema assets/schemas/rss-v2.0.xsd public/rss.xml + +test-sitemap: # Test sitemap + xmllint --noout --schema assets/schemas/sitemap-v0.9.xsd public/sitemap.xml +# xmllint --noout --schema assets/schemas/sitemapindex-v0.9.xsd public/sitemap.xml + +test-jsonfeed: # Test JSONFeed + check-jsonschema --schemafile assets/schemas/jsonfeed-v1.1.json public/index.json @@ -52,6 +52,7 @@ let pkgs.jing pkgs.libxml2 pkgs.libxslt + pkgs.unixtools.column pkgs.validator-nu pkgs.yj ]} |