diff --git a/.gitignore b/.gitignore index 3c3629e..9cc2107 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +webroot diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9029352 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +# Builds website +# + +header := _includes/header.html +footer := _includes/footer.html + +input_html := $(wildcard *.html) +input_images := $(wildcard images/*.png) +input_scripts := $(shell find scripts/ -name '*.js') + +outdir := webroot +output_html := $(addprefix $(outdir)/, $(input_html)) +output_images := $(addprefix $(outdir)/, $(input_images)) +output_scripts := $(addprefix $(outdir)/, $(input_scripts)) + +.PHONY: default clean + +default: $(outdir) $(output_html) $(output_images) \ + $(output_scripts) $(outdir)/style.css + +$(outdir): + mkdir -p $@ $@/images $@/scripts/ex + +$(outdir)/style.css: style.css | $(outdir) + cp $< $@ + +$(outdir)/scripts/%.js: scripts/%.js | $(outdir) + cp -r $< $@ + +$(outdir)/images/%.png: images/%.png | $(outdir) + cp -r $< $@ + +$(outdir)/%.html: %.html $(header) $(footer) | $(outdir) + cat $(header) $< $(footer) > $@ + +clean: + ${RM} -r webroot diff --git a/_includes/README b/_includes/README new file mode 100644 index 0000000..774333a --- /dev/null +++ b/_includes/README @@ -0,0 +1,2 @@ +Files in this directory should not be uploaded to the web root. They are used by +the build script as an alternative to dynamic pages (e.g. with PHP). diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..d7ea4fe --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,16 @@ + + +
+ Copyright © 2011 Mike Gerwitz +
+ + + + + +