Skip to content

Instantly share code, notes, and snippets.

@jhawthorn
Last active August 29, 2015 14:01
Show Gist options
  • Save jhawthorn/8f6c8d0d0abdbfe2ce0c to your computer and use it in GitHub Desktop.
Save jhawthorn/8f6c8d0d0abdbfe2ce0c to your computer and use it in GitHub Desktop.
HTMLFILES=www/index.html $(wildcard www/articles/*.html)
TXTFILES=$(wildcard www/*.html)
CSSFILES = $(wildcard www/assets/*.css)
HTMLTARGETS=$(HTMLFILES:www/%.html=build/%.html)
all: build
node_modules:
npm install minify
build/assets/site.css: $(CSSFILES) node_modules
@mkdir -p $(dir $@)
cat $(CSSFILES) | node_modules/.bin/minify -css > $@
build/%.html: www/%.html ga.txt node_modules
@mkdir -p $(dir $@)
cat $< ga.txt | node_modules/.bin/minify -html > $@
build: build/assets/site.css $(HTMLTARGETS)
clean:
rm -Rf build/ node_modules
.PHONY: all build clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment