-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (38 loc) · 1.17 KB
/
Makefile
File metadata and controls
48 lines (38 loc) · 1.17 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
.PHONY: dev serve build clean lint lint-md lint-html lint-install
# Load environment variables from .env if it exists
ifneq (,$(wildcard ./.env))
include .env
export
endif
# Development server with fast render disabled for accurate previews
dev:
hugo server --disableFastRender
# Alias for dev
serve: dev
# Build the site for production
build:
hugo --minify --environment production
# Clean generated files
clean:
rm -rf public/ resources/
# =============================================================================
# Linting
# =============================================================================
# Install linting dependencies (run once)
lint-install:
npm install -g markdownlint-cli2 htmlhint
# Lint all (markdown + HTML if built)
lint: lint-md
@if [ -d "public" ]; then \
$(MAKE) lint-html; \
else \
echo "Tip: Run 'make build' first, then 'make lint-html' to lint generated HTML"; \
fi
# Lint Markdown files in content directory
lint-md:
@echo "Linting Markdown files..."
markdownlint-cli2 "content/**/*.md"
# Lint generated HTML (requires build first)
lint-html:
@echo "Linting HTML files..."
htmlhint "public/**/*.html" --config .htmlhintrc