-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 1.94 KB
/
Copy pathMakefile
File metadata and controls
67 lines (54 loc) · 1.94 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
SHELL := /bin/bash
.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/
rm -f static/tinysearch_engine*
.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
wasm-opt --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
# Creating a temporary directory here because wasm-pack seems to overwrite
# the public output directory. Haven't yet found the reason why.
.PHONY: index
index: content ## Build the search index with tinysearch
# Commented out tinysearch build for now
# mkdir -p tinysearch_out
# mv public/tinysearch.json/index.html public/search_index.json
# RUST_LOG=debug tinysearch --release -o -m wasm -p tinysearch_out public/search_index.json
# mv tinysearch_out/* public
# rm -rf tinysearch_out
.PHONY: minify
minify: ## Compress JavaScript assets
terser --compress --mangle --output public/search_min.js -- static/search.mjs
.PHONY: build
build: stars content index 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
zola serve --fast
.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