-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (29 loc) · 948 Bytes
/
Makefile
File metadata and controls
35 lines (29 loc) · 948 Bytes
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
.PHONY: help draft serve test compress submodule
.DEFAULT_GOAL = help
help:
@printf "Usage:\n"
@grep -E '^[a-zA-Z_-]+:.*?# .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[1;34mmake %-10s\033[0m%s\n", $$1, $$2}'
draft: # Start a draft blog post
( \
touch draft.md; \
echo "---" >> draft.md; \
echo "title:" >> draft.md; \
echo "date: $(shell date +%Y-%m-%d)" >> draft.md; \
echo "tags:" >> draft.md; \
echo " - " >> draft.md; \
echo "draft: true" >> draft.md; \
echo "---" >> draft.md; \
echo "" >> draft.md; \
mv draft.md content/blog/; \
)
serve: # Serve site locally
hugo serve --buildDrafts --buildFuture
test: # Test generated HTML files.
hugo
link_check public/ --host georgeho.org > link_check.txt 2>&1
rm -rf public/
clean: # Clean generated files
rm -rf link_check.txt public/
compress: # Compress images losslessly
jpegoptim static/assets/images/*.jpg
optipng static/assets/images/*.png