aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJakob Odersky <jakob@driver.xyz>2018-09-14 17:59:21 -0700
committerJakob Odersky <jakob@driver.xyz>2018-09-14 17:59:21 -0700
commit876fccbbde53e27b3fb820808d2c336ca71aa7e1 (patch)
tree0143fa9b434091470d2466a6d719e9bb37d969d9 /Makefile
parent07fb4ce6471aef531a1246c8fd9d200f23c119d2 (diff)
downloadbest-practices-876fccbbde53e27b3fb820808d2c336ca71aa7e1.tar.gz
best-practices-876fccbbde53e27b3fb820808d2c336ca71aa7e1.tar.bz2
best-practices-876fccbbde53e27b3fb820808d2c336ca71aa7e1.zip
Make this repo a standalone website
These changes add the ability to generate a full website from individual style guides. The website can be viewed [here](drivergroup.github.io/best-practices). Also included, are the following additions: - Improve recommendations for Scala. - Add more recommendations for Git. - Add recommendations for Shell Script.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9239635
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+title="Style Guide"
+subtitle="Software Engineering at Driver"
+url=https://github.com/drivergroup/best-practices
+git_url=git@github.com:drivergroup/best-practices.git
+
+ghpages=.gh-pages
+
+markdown=$(wildcard guides/*.md)
+html_out=$(addprefix $(ghpages)/, $(notdir $(markdown:.md=.html)))
+
+
+all: $(html_out)
+
+$(ghpages):
+ mkdir $(ghpages)
+ cp -r assets $(ghpages)
+
+
+$(ghpages)/%.html: guides/%.md $(ghpages)
+ pandoc \
+ --standalone \
+ --template=layout.html \
+ --from=markdown \
+ --to=html5 \
+ --metadata=title:$(title) \
+ --metadata=subtitle:$(subtitle) \
+ --metadata=date:$$(date --iso) \
+ --variable=url:$(url) \
+ --out=$@ $<
+
+publish: $(html_out)
+ git -C $(ghpages) init
+ git -C $(ghpages) add .
+ git -C $(ghpages) commit -m "Publish website" || true
+ git -C $(ghpages) push -f $(git_url) master:gh-pages
+
+clean:
+ rm -rf $(ghpages)
+
+.PHONY: all clean publish