forked from ChrisCummins/chriscummins.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (41 loc) · 1.28 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.PHONY: all
all: js/site.min.js img
bundle exec jekyll build --drafts
js/site.min.js: js/site.js
uglifyjs $< > $@
.PHONY: img
img:
for img in $$(ls img/art/*.jpg | grep -v small.jpg); do \
ffmpeg -y -i $$img -vf scale=1080:-1 $$(echo $$img | sed 's/\.jpg//')-small.jpg 2>/dev/null; \
done
.PHONY: run
run:
bundle exec jekyll serve --drafts --future --host=0.0.0.0
# Dependencies.
.PHONY: install, install-ffmpeg, install-deps
install: install-ffmpeg
bundle install
npm install uglify-js -g
ifeq ($(shell uname),Darwin)
install-ffmpeg:
brew install ffmpeg
else
install-ffmpeg:
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
endif
.PHONY: ls-unused-banners
ls-unused-banners:
@mkdir -p .build
@ls img/banners/* | sed 's,^,/,' > .build/banners.txt
@git grep -h 'banner:' | awk '{print $$2;}' | sort -u > .build/used-banners.txt
@grep -F -x -v -f .build/used-banners.txt .build/banners.txt
.PHONY: help
help:
@echo "usage: make {all,install,run,ls-unused-banners}"
@echo
@echo " all build site"
@echo " install install build dependencies"
@echo " run build and serve site on http://localhost:4000"
@echo " ls-unused-banners list banner images which have not appeared in posts"