From 76c538365e2b18f41e4b24cbc8b2c19548ad36af Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 17 Feb 2016 08:33:47 -0800 Subject: [PATCH] live reloading; allow other pages --- Makefile | 20 +++++++++++++++++--- README | 17 +++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3817a74..632b95a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,19 @@ -index.html: index.md index.tmpl - pandoc index.md --template index.tmpl -o index.html +all: $(patsubst %.md,%.html,$(wildcard *.md)) Makefile watch: - fswatch -0 *.{md,tmpl} | xargs -0 -n1 -I{} make + fswatch -0 *.{md,tmpl} | xargs -0 -n1 -I{} make all + +livereload: + livereloadx --static . + +clean: + rm -f $(patsubst %.md,%.html,$(wildcard *.md)) + +PANDOC = pandoc # --from markdown --to html + +# index.html: index.md index.tmpl +# $(PANDOC) --template index.tmpl index.md -o $@ + +%.html: %.md index.tmpl + $(PANDOC) --template index.tmpl $< -o $@ + diff --git a/README b/README index 40d13cb..02919ec 100644 --- a/README +++ b/README @@ -14,12 +14,25 @@ A. drop link suggestions etc. on the etherpad linked in the site footer B. fork the github repo, submit a pull request C. regular contributors can request commit access -Before committing, rebuild the HTML: +Before committing, rebuild the HTML (requires pandoc): $ make and include it in your commit. -To run make on each change, install fswatch and: +To rebuild on each file change (requires fswatch): $ make watch + +To rebuild and reload the browser page on file change, + +Method 1 (requires livereloadx): + +$ make watch +in another window: +$ npm install -g livereloadx +$ make livereload +visit http://localhost:35729 + +Method 2 (requires LiveReload): +add the site folder in the LiveReload GUI, configure custom command "make", ?