From 7da42c6e577f49ad4981f24c833b2e1d86357e0b Mon Sep 17 00:00:00 2001 From: lemurianmage Date: Fri, 12 Jun 2026 23:35:20 +0200 Subject: redesign and move to markdown with a perl+make build system --- makefile | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'makefile') 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 -- cgit v1.2.3