aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: caf2dee8ac90ae6c5206032f7d122f00454e92d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
help: # Show this help menu
	@printf "\n%s\n\n" "$$(grep -E '^[a-zA-Z0-9 -]+:.*#'  Makefile | column -s ':#' -t)"

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

build-js: # Build js bundle
	deno run --allow-all static/js/index-bundle.ts

build-site: # Build site
	rm -rf public
	hugo --logLevel debug --templateMetrics --templateMetricsHints
	hugo --logLevel debug --templateMetrics --templateMetricsHints
	rm -f .hugo_build.lock

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
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/alert-circle.svg       --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/arrow-down-circle.svg  --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/arrow-left.svg         --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/arrow-right.svg        --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/arrow-up.svg           --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/at-sign.svg            --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/calendar.svg           --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/circle.svg             --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/clock.svg              --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/edit.svg               --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/external-link.svg      --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/eye-off.svg            --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/eye.svg                --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/file-text.svg          --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/git-commit.svg         --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/globe.svg              --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/heart.svg              --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/home.svg               --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/link.svg               --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/map-pin.svg            --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/refresh-cw.svg         --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/rss.svg                --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/search.svg             --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/trash-2.svg            --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/user.svg               --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/users.svg              --output-dir static/icons/feather
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/LICENSE                       --output-dir static/icons/tabler
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/archive.svg             --output-dir static/icons/tabler
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/book-2.svg              --output-dir static/icons/tabler
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/clock.svg               --output-dir static/icons/tabler
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/code.svg                --output-dir static/icons/tabler
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/notes.svg               --output-dir static/icons/tabler
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/pinned.svg              --output-dir static/icons/tabler
	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/settings.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
	curl --silent --remote-name https://raw.githubusercontent.com/tabler/tabler-icons/master/icons/tags.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