forked from shapeshed/shapeshed.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (19 loc) · 772 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SHELL := /bin/bash
CSSMD5 = $(shell md5sum ./public/css/styles.css | awk '{ print $$1 }')
build: clean hugo css minify-html gzip-static
clean:
@rm -Rf ./public
hugo:
@hugo --quiet
gzip-static:
@find ./public -type f \( -name "*.html" -o -name "*.css" -o -name "*.xml" \) -exec gzip -k -f -9 {} \;
minify-html:
@minify -r --match=\.html public -o public
optimize-images:
find ./static/images/articles -mtime -1 -name '*.png' | xargs optipng -o7 -strip all
css:
@mv ./public/css/styles.css ./public/css/$(CSSMD5).css
@minify ./public/css/$(CSSMD5).css -o public/css/$(CSSMD5).css
@find ./public -name index.html | xargs sed -i "s/styles\.css/$(CSSMD5)\.css/"
deploy:
@rsync -az -e "ssh" --delete ./public/ static1.shapeshed.com:/srv/http/shapeshed.com