-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (60 loc) · 2.03 KB
/
Makefile
File metadata and controls
74 lines (60 loc) · 2.03 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# targets that aren't filenames
.PHONY: all clean deploy-publish deploy-preview deploy-github build serve test
all: build
clean:
$(RM) -r _site _site-publish $(BIB_FILES)
# Build the site
build: _site/
BIBBLE = python bib/bibble_wrapper.py
# Delete targets that fail to build
.DELETE_ON_ERROR:
# Install Gemfiles
TOOLS := Gemfile.lock pip.install
Gemfile.lock: Gemfile
bundle install
touch $@
# Install Python dependencies
pip.install: requirements.txt
python -m pip install --user -r requirements.txt 2>&1 | tee $@
# Source Files
# This builds a list of files that make up the website
# Files in the root directory are only added if *.html/*.md and are tracked by
# git.
dirs := _data _includes _layouts _posts _projects bib css img js
SRC := $(foreach dir, $(dirs), $(wildcard $(dir)/*))
SRC += $(shell git ls-tree -r --name-only HEAD -- *.md)
SRC += $(shell git ls-tree -r --name-only HEAD -- *.html)
SRC += _config.yml
# Generate HTML files for publications
.DELETE_ON_ERROR: _includes/%.html
BIB_FILES := _includes/pubs.html _includes/patents.html
_includes/%.html: bib/%.bib bib/publications.tmpl
mkdir -p _includes
$(BIBBLE) $+ > $@
_site/ : $(BIB_FILES) $(SRC) $(TOOLS)
rm -rf $@
bundle exec jekyll build
touch $@
# Build and serve the site for viewing locally
# Note: This will update most pages as you edit them, except for ones generated
# externally to Jekyll. (Think Biblography pages). You can regenerate those, but
# running `make build` in a seperate shell. Jeykell then reload with the updated
# pages
# you can configure these at the shell, e.g.:
# SERVE_PORT=5001 make serve
SERVE_HOST ?= 127.0.0.1
SERVE_PORT ?= 5000
serve: _site/ Gemfile.lock
bundle exec jekyll serve -l -I \
--port $(SERVE_PORT) --host $(SERVE_HOST)
# Run test on the website using htmlproofer
test: _site/ $(TOOLS)
@echo "Running pre-commit"
# pre-commit run -a
@echo "Checking _data/people.yml"
python3 dev/check_people.py
@echo "Checking links"
bundle exec htmlproofer \
--disable-external \
--check-html --check-img-http --enforce-https \
_site