summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKatherine Peeters <katherine.peeters@leagueh.xyz>2020-10-01 10:59:49 -0400
committerKatherine Peeters <katherine.peeters@leagueh.xyz>2020-10-01 10:59:49 -0400
commitb5090a43d392cdb7b59b26f7938ab4f221c12e7b (patch)
treeab67e8cd6870d596ea612321e7d8ff9f742ecd9b /Makefile
parent9934455980069f01e8e553268f274705221dd63a (diff)
downloadloh-website-b5090a43d392cdb7b59b26f7938ab4f221c12e7b.tar.gz
Replaced compile script with a Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..60b029d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+MARKDOWN=$(shell find . -type f -name "*.md" -print)
+HTML=$(MARKDOWN:%.md=%.html)
+RSS=$(shell find . -type d -name "*.rss" -print)
+RSS_XML=$(RSS:%.rss=%.xml)
+
+.PHONY: clean
+.PHONY: all
+
+all: $(HTML) $(RSS_XML) site/favicon.ico
+
+site/favicon.ico: site/icon.svg
+ convert $^ -resize 128x128 $@
+
+%.html: %.md header.html
+ pandoc -s --metadata pagetitle="League of Humanity" -H header.html $< -o $@
+ sed -i.tmp -e 's/\.md/\.html/g' $@
+ rm $@.tmp
+
+%.xml: %.rss %.rss.header.xml %.rss.item_header.xml rss_item_footer.xml rss_footer.xml
+ cat $<.header.xml > $@
+ for i in $(shell ls -r $</*.xml | head -n 15) ; do \
+ cat $<.item_header.xml >> $@; \
+ echo "<pubDate>$(shell date -r $$i '+%a, %d %b %Y')</pubDate>" >> $@; \
+ cat $$i >> $@; \
+ cat rss_item_footer.xml >> $@; \
+ done
+ cat rss_footer.xml >> $@
+
+clean:
+ rm -f ${HTML}
+ rm -f ${RSS_XML}
+ rm -f site/favicon.ico
+