commit 2872dca785533756f61e319cabbf05d96c1e43ae Author: Rhiannon Morris Date: Tue Aug 18 09:35:36 2020 +0200 first diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d4f4b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +_build +_tmp diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7aa5ac0 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +TMPDIR ?= _tmp +BUILDDIR ?= _build +PAGESDIR ?= pages +DATADIR ?= data +TEMPLATE ?= $(DATADIR)/template.html + +PAGES != find $(PAGESDIR) -name '*.md' +OUTPUTPAGES = $(patsubst $(PAGESDIR)/%.md,$(BUILDDIR)/%.html,$(PAGES)) + + +.PHONY: all +all: build + +.PHONY: build +build: $(OUTPUTPAGES) + +$(BUILDDIR)/%.html: $(PAGESDIR)/%.md $(TEMPLATE) + mkdir -p $(dir $@) + pandoc -s --toc --template $(TEMPLATE) -o $@ $< + +.PHONY: clean distclean +clean: + rm -rf $(BUILDDIR) +distclean: clean + rm -rf $(TMPDIR) diff --git a/data/template.html b/data/template.html new file mode 100644 index 0000000..cd59485 --- /dev/null +++ b/data/template.html @@ -0,0 +1,39 @@ + + + + +$for(css)$ + +$endfor$ + +$for(header-includes)$ +$header-includes$ +$endfor$ + +$pagetitle$ + +$for(include-before)$ +$include-before$ +$endfor$ + +$if(title)$ +
+

$title$

+ $if(subtitle)$ +

$subtitle$

+ $endif$ +
+ +$endif$ +$if(toc)$ + +$endif$ + +$body$ + +$for(include-after)$ +$include-after$ +$endfor$ diff --git a/pages/index.md b/pages/index.md new file mode 100644 index 0000000..8bc2c2f --- /dev/null +++ b/pages/index.md @@ -0,0 +1,11 @@ +--- +title: hello +... + +# bleep + +yes + +# bloop + +yes!!!