-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (51 loc) · 1.93 KB
/
Copy pathMakefile
File metadata and controls
64 lines (51 loc) · 1.93 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
SHELL := /bin/bash
TINYSEARCH_VERSION := 0.11.0
.PHONY: help
help: ## This help message
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
.PHONY: clean-img
clean-img: ## Remove autogenerated image files
rm -rf public/
find static -name "*.avif" -delete
find static -name "*.webp" -delete
.PHONY: clean-pub
clean-pub: ## Remove build files
rm -rf public/
.PHONY: clean
clean: clean-pub clean-img ## Remove public files and images
.PHONY: versions
versions: ## Show versions of tools
zola --version
gh-stats --version
tinysearch --version
wasm-opt --version
terser --version
cavif --version
convert -version
.PHONY: content
content: ## Build the content of the static site with zola
zola build
.PHONY: images
images: ## Create avif images
cargo run --manifest-path ./helpers/img/Cargo.toml
# Keep a copy in static/ so plain `zola serve` can load search locally.
# Production still gets a freshly generated copy in public/.
.PHONY: index
index: content ## Build the search index with tinysearch
@tinysearch --version | grep -q "tinysearch $(TINYSEARCH_VERSION)" || (echo "tinysearch $(TINYSEARCH_VERSION) is required"; exit 1)
tinysearch --release -o -m wasm -p static public/search_index.en.json
cp static/tinysearch_engine.wasm public/
rm public/search_index.en.json
.PHONY: minify
minify: index ## Compress JavaScript assets
terser --module --compress --mangle --output public/search.mjs -- static/search.mjs
.PHONY: build
build: stars minify ## Build static site and search index, minify JS
.PHONY: build-quick
build-quick: content ## Build static site
.PHONY: dev run serve
dev run serve: ## Serve website locally, including drafts
zola serve --fast --drafts
.PHONY: stars
stars: ## Update Github stars statistics for my projects
gh-stats --filter gitpod --stars 100 --template .star-counter-template.md --output content/static/about/stars.md