aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2023-11-02 11:11:08 -0400
committertdro <tdro@noreply.example.com>2023-11-02 11:11:08 -0400
commitf372675eb5ab4f6acabae14479479c04c3d139f5 (patch)
tree0a63f1c1131b8921ea384c577a5f8218e078827a /Makefile
parent31ed5f7b55b9934648878a8af84abb2af334a874 (diff)
downloadcanory-f372675eb5ab4f6acabae14479479c04c3d139f5.tar.gz
canory-f372675eb5ab4f6acabae14479479c04c3d139f5.tar.bz2
canory-f372675eb5ab4f6acabae14479479c04c3d139f5.zip
Makefile: House keeping
Add help
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile117
1 files changed, 60 insertions, 57 deletions
diff --git a/Makefile b/Makefile
index ff832d1..1b1ac99 100644
--- a/Makefile
+++ b/Makefile
@@ -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