about summary refs log tree commit diff homepage
path: root/Makefile
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2023-02-16 20:52:49 +0900
committerNguyễn Gia Phong <mcsinyx@disroot.org>2023-02-16 20:52:49 +0900
commit21f317aab2368ec6ef341dc23b4257ffa24946af (patch)
treef525eb1f04c031dc5b3d3817e7588f860d0cad3f /Makefile
parente24d423e566d3cc688acd359991359d59990e3cb (diff)
downloadpx-21f317aab2368ec6ef341dc23b4257ffa24946af.tar.gz
Use symlink instead of meta refresh redirect
I couldn't figure out a way to disable caching for the latter.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index c6671a8..7f69823 100644
--- a/Makefile
+++ b/Makefile
@@ -8,16 +8,19 @@ PREFIX ?= /tmp/px.cnx.gdn
 
 PICTURES := $(filter-out %.small.jpg $(PREFIX)/%.jpg, $(wildcard */*.jpg))
 THUMBNAILS := $(patsubst %.jpg,%.small.jpg,$(PICTURES))
-DATA := $(wildcard */index.xml)
+DATA := $(wildcard */index.xml) index.xml
 PAGES := $(patsubst %.xml,%.xhtml,$(DATA))
 OUTPUTS := $(THUMBNAILS) $(PAGES) atom.xml
-ALL := $(OUTPUTS) $(PICTURES) index.xhtml favicon.png style.css
+ALL := $(OUTPUTS) $(PICTURES) favicon.png style.css
 
 all: $(OUTPUTS)
 
 %.small.jpg: %.jpg
 	epeg -w 1024 -p -q 80 $< $@
 
+index.xml: 06/index.xml
+	ln -fs $< $@
+
 %.xhtml: %.xml page.xslt
 	xsltproc page.xslt $< > $@
 
@@ -25,7 +28,7 @@ atom.xml: atom.xslt $(DATA) $(wildcard *.svg)
 	xsltproc atom.xslt > atom.xml
 
 clean:
-	rm -f atom.xml */{index.xhtml,*.small.jpg}
+	rm -f atom.xml index.{xml,xhtml} */{index.xhtml,*.small.jpg}
 
 $(PREFIX)/%: %
 	install -Dm644 $< $@
@@ -35,7 +38,6 @@ install: all $(addprefix $(PREFIX)/,$(ALL))
 uninstall:
 	rm -fr $(PREFIX)
 
-live: $(THUMBNAILS)
-	ln -fs index.xhtml index.xml
+live: $(THUMBNAILS) index.xml atom.xml
 
 .PHONY: all clean install uninstall live