aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorlemurianmage <azureazure@disroot.org>2026-06-12 23:35:20 +0200
committerlemurianmage <azureazure@disroot.org>2026-06-12 23:35:20 +0200
commit7da42c6e577f49ad4981f24c833b2e1d86357e0b (patch)
treeb1921f453b86cd5062adbd34b5e1b8dccc8f32ef /makefile
parentcf102ad6c7d171dd500cae8b419b7f5c1e796ab4 (diff)
downloadslimegirl.nexus-7da42c6e577f49ad4981f24c833b2e1d86357e0b.tar.gz
redesign and move to markdown with a perl+make build system
Diffstat (limited to 'makefile')
-rw-r--r--makefile35
1 files changed, 22 insertions, 13 deletions
diff --git a/makefile b/makefile
index d356503..8c7f1de 100644
--- a/makefile
+++ b/makefile
@@ -1,28 +1,37 @@
-# this fucking sucks lol
-
all: build
+build: $(patsubst src/%.md, out/%.html, $(shell find src -type f)) \
+ $(patsubst static/%, out/%, $(shell find static -type f)) \
+ $(patsubst src/%, out/%, $(shell find src -type f ! -name "*.md"))
+
serve:
xdg-open http://localhost:8000/
- python3 -m http.server -d public/
+ python3 -m http.server -d out/
watch:
- find src/ templates/ -type f | entr make build
+ find . -type f ! -path "./out/*" | entr make build
+
+out/%.html: src/%.md template.html template.pl
+ @mkdir -p $(dir $@)
+ ./template.pl $< > $@
+
+out/%: src/%
+ @mkdir -p $(dir $@)
+ cp $< $@
-build: # shit breaks when index.org doesnt exist idk why
- [ -f src/blog/index.org ] || touch src/blog/index.org
- @mkdir -p public/
- emacs -Q --script build-site.el
+out/%: static/%
+ @mkdir -p $(dir $@)
+ cp $< $@
-compress: build # for gzip-static, check the obsd httpd.conf(5) man page
- find public/ -type f \( -name "*.html" -o -name "*.css" -o -name "*.xml" \) \
+compress: build # for gzip-static, check the openbsd httpd.conf(5) man page
+ find out/ -type f \( -name "*.html" -o -name "*.css" \) \
-exec gzip -k {} \;
publish: compress build
- rsync -rcvP --delete public/ \
+ rsync -rcvP --delete out/ \
lemurianmage@slimegirl.nexus:/var/www/htdocs/slimegirl.nexus
clean:
- rm -r public/
+ rm -r out/
-.PHONY: serve watch build compress publish clean
+.PHONY: build serve watch compress publish clean