1 npmbin := ./node_modules/.bin
8 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
11 # Builds intermediate files. Needs a _site built first though
12 update: _site critical
16 bundle exec jekyll build --incremental
18 critical: _site ## Builds critical path CSS/JS
19 node _support/critical.js
21 # Ensure that bins are available.
23 @if [ ! -d $(npmbin) ]; then \
25 echo "Error: $(npmbin) not found, you may need to run '[docker-compose run --rm web] yarn install'."; \
29 @if ! which jekyll &>/dev/null; then \
31 echo "Warning: Jekyll not found, you may need to run '[docker-compose run --rm web] bundle install'."; \
35 dev: ensure-bin ## Starts development server
36 $(npmbin)/concurrently -k -p command -c "blue,green" \
40 dev-webpack: ensure-bin
41 $(npmbin)/webpack --watch --colors -p
43 dev-jekyll: ensure-bin
44 if [ -f _site ]; then \
45 bundle exec jekyll serve --safe --trace --drafts --watch --incremental --host $(HOST) --port $(PORT); \
47 bundle exec jekyll serve --safe --trace --drafts --watch --host $(HOST) --port $(PORT); \
50 test: _site ## Runs rudimentary tests
51 @test -f _site/vim.html
52 @test -f _site/react.html
53 @test -f _site/index.html
54 @grep "<script src" _site/index.html >/dev/null
55 @grep "<script src" _site/vim.html >/dev/null
56 @grep "<script src" _site/react.html >/dev/null
60 @echo "If your build failed at this point, it means"
61 @echo "the site failed to generate. Check the project"
62 @echo "out locally and try to find out why."