-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmakefile
33 lines (26 loc) · 859 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
28
29
30
31
32
33
# Pull the baseurl from _config.yml
BASEURL ?= $(word 2, $(shell grep baseurl _config.yml))
build: _site/
# Use rbenv to change the version of bundler, then run make like this:
# make BUNDLER=$(rbenv which bundler)
BUNDLER ?= bundle
Gemfile.lock: Gemfile
$(BUNDLER) install
touch $@
SRC := $(shell git ls-tree -r --name-only HEAD -- **/*.md)
_site/: Gemfile.lock _config.yml $(SRC)
rm -rf $@ && mkdir -p $@
$(BUNDLER) exec jekyll build -d $(join $@, $(BASEURL)) -b $(BASEURL)
touch $@
# Run test on the website using htmlproofer
test: _site/ Gemfile.lock
$(BUNDLER) exec htmlproofer \
--root-dir=_site/ \
--disable-external=true \
_site/
# Build and serve the site for viewing locally
serve: _site/ Gemfile.lock
$(BUNDLER) exec jekyll serve
# Archive Site for Publishing
site.zip: _site/
cd _site/$(BASEURL) && zip -r $(abspath site.zip) .