This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
58 lines (52 loc) · 1.84 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
56
57
58
.PHONY: help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: run
run: ## Run the development server, watching for changes.
bundle exec jekyll serve -w
.PHONY: check
check: check-ratings check-permalinks lint ## Check the site for ratings, permalinks, build sanity, and HTML well-formedness.
.PHONY: build
build: ## Build the site into the default location (_site/)
bundle exec jekyll build --verbose --future
.PHONY: check-permalinks
check-permalinks: build ## Check that each entry builds its own unique permalink.
@ echo
@ echo "Checking for duplicate permalinks..."
# Simple check that each post generates its own index.html file
# Looks to make sure that there aren't more sources than destinations, but
# cannot test for category indices.
@ ( \
src=`find entry/_posts -name "????-??-??-*.*" | wc -l`; \
dest=`find _site/entry -name index.html | wc -l`; \
if [ $$src -gt $$dest ]; then \
echo "!!! Source was $$src"; \
echo "!!! Dest was $$dest"; \
echo "!!! Mismatched source and dest entries; maybe a duplicate permalink?"; \
exit 1; \
fi \
)
@ echo "No duplicates found, but that was a naive test. Check by hand!"
@ echo
.PHONY: check-ratings
check-ratings: ## Check that each entry has a valid rating.
@ echo
@ echo "Checking for ratings..."
@ ( \
for i in `find entry/_posts -name "????-??-??-*.*"`; do \
echo "Checking $$i"; \
grep -qE '^rating:\s+(green|yellow|red)$$' $$i; \
done \
)
@ echo "Ratings found in all files."
@ echo
.PHONY: lint
lint: ## Check that all generated HTML files are well-formed.
bundle exec jekyll hyde
bundle exec htmlproofer _site \
--check-favicon \
--check-html \
--check-opengraph \
--file-ignore '/_site\/posts\/.*/' \
--log-level debug \
--internal-domains "ENTER YOUR DOMAIN HERE"