aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2018-11-19 13:29:15 -0800
committerJakob Odersky <jakob@odersky.com>2018-11-19 13:29:15 -0800
commit31ecae8b901060644175f39241c65a06b78b2a83 (patch)
treef01bd382c30905fa4be21dc72cc879aeafa72412 /Makefile
parent14da66191f12755de633fe839aadd6bb2f09fd57 (diff)
downloadwebsite-31ecae8b901060644175f39241c65a06b78b2a83.tar.gz
website-31ecae8b901060644175f39241c65a06b78b2a83.tar.bz2
website-31ecae8b901060644175f39241c65a06b78b2a83.zip
Move to pandoc and makefile based publishing system
This drops the jekyll requirement to publish the website and instead relies on pandoc to convert markdown to html and assemble pages.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b7a839d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,60 @@
+target=_site
+
+target_files=\
+ $(patsubst %,$(target)/%, $(shell find assets -type f)) \
+ $(patsubst %,$(target)/%, $(shell find projects -type f)) \
+ $(patsubst %,$(target)/%, $(shell find talks -type f)) \
+ $(target)/404.html \
+ $(target)/CNAME \
+ $(target)/cv.pdf \
+ $(target)/index.html \
+ $(target)/keybase.txt \
+ $(target)/projects.html \
+ $(target)/talks.html
+
+all: $(target_files)
+
+publish: $(target_files)
+ git -C $(target) init
+ git -C $(target) add .
+ git -C $(target) commit -m "Publish website" || true
+ git -C $(target) push -f git@github.com:jodersky/website master:gh-pages
+
+clean:
+ rm -rf $(target)
+
+$(target)/assets/%: assets/%
+ @mkdir -p $(@D)
+ cp $< $@
+
+$(target)/%.html: %.html layout.pandoc.html
+ @mkdir -p $(@D)
+ pandoc \
+ --standalone \
+ --template=layout.pandoc.html \
+ --from=markdown+yaml_metadata_block-native_divs-native_spans \
+ --to=html5 \
+ --variable=base_path:$(shell realpath --relative-to=$(shell dirname $<) .) \
+ --variable=navbar_$(patsubst %.html,%,$<):true \
+ --out=$@ $<
+
+$(target)/%.html: %.md layout.pandoc.html
+ @mkdir -p $(@D)
+ pandoc \
+ --standalone \
+ --template=layout.pandoc.html \
+ --from=markdown \
+ --to=html5 \
+ --variable=base_path:$(shell realpath --relative-to=$(shell dirname $<) .) \
+ --variable=navbar_$(patsubst %.md,%,$<):true \
+ --out=$@ $<
+
+$(target)/%: %
+ @mkdir -p $(@D)
+ cp $< $@
+
+$(target)/talks/scala-channels.html: talks/scala-channels.html
+ @mkdir -p $(@D)
+ cp $< $@
+
+.PHONY: all clean publish