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