1
0

live reloading; allow other pages

This commit is contained in:
Simon Michael
2016-02-17 08:33:47 -08:00
parent ad1bea0169
commit 76c538365e
2 changed files with 32 additions and 5 deletions

View File

@@ -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 $@

17
README
View File

@@ -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", ?