-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (50 loc) · 1.91 KB
/
Copy pathMakefile
File metadata and controls
61 lines (50 loc) · 1.91 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
# Capa.io Makefile
# Simplified build commands for Hugo documentation site
.PHONY: dev build check clean deploy help submodule
# Default target
.DEFAULT_GOAL := help
# Initialize git submodules (required for Docsy theme)
submodule:
git submodule update --init --recursive
# Development server with drafts
dev:
./scripts/hugo.sh server -D
# Development server binding to all interfaces
dev-all:
./scripts/hugo.sh server -D --bind 0.0.0.0
# Production build
build:
HUGO_ENV="production" ./scripts/hugo.sh --gc --minify --cleanDestinationDir
# Validate all pages without changing generated site files
check:
node --test scripts/*.test.mjs
HUGO_ENV="production" HUGO_READ_ONLY=1 ./scripts/hugo.sh --gc --minify --renderToMemory --noBuildLock
# Clean build artifacts
clean:
rm -rf docs/
rm -rf public/
rm -rf resources/
# Deploy to GitHub Pages through the workflow triggered by master
deploy: check
git push origin master
# Check for broken links
link-check:
@./scripts/hugo.sh server --port 1313 >/tmp/capa-hugo.log 2>&1 & \
pid=$$!; \
trap 'kill $$pid 2>/dev/null || true' EXIT; \
sleep 3; \
npx --yes linkinator http://localhost:1313 --recurse --timeout 10000 \
--skip '^https?://(?!(localhost|127\\.0\\.0\\.1):1313)'
# Show help
help:
@echo "Capa.io Documentation - Available Commands:"
@echo ""
@echo " make submodule - Initialize git submodules (Docsy theme)"
@echo " make dev - Run development server with drafts"
@echo " make dev-all - Run dev server binding to all interfaces"
@echo " make build - Build production site (outputs to ignored docs/)"
@echo " make check - Validate the production site without writing output"
@echo " make clean - Remove build artifacts"
@echo " make deploy - Validate and push master; CI builds and deploys Pages"
@echo " make link-check - Crawl the local site and fail on broken links"
@echo " make help - Show this help message"