aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
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