-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 1.2 KB
/
Makefile
File metadata and controls
44 lines (35 loc) · 1.2 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
PYTHON=python3
VENV=.venv
ACTIVATE=$(VENV)/bin/activate
REQ=requirements.txt
BLOG_DIR=docs/blog/posts
SOCIAL_DIR=docs/assets/social
BASE_URL=http://127.0.0.1:9000/blog
# Default target
all: serve
# Create virtual environment if missing
$(VENV)/bin/activate: $(REQ)
@test -d $(VENV) || $(PYTHON) -m venv $(VENV)
@. $(ACTIVATE); pip install --upgrade pip
@. $(ACTIVATE); pip install -r $(REQ)
venv: $(VENV)/bin/activate
# Start mkdocs dev server (after ensuring venv)
serve: venv
@echo "Starting mkdocs server at $(BASE_URL)"
@. $(ACTIVATE); mkdocs serve --livereload --dev-addr=127.0.0.1:9000
# Build the site once
build: venv
@. $(ACTIVATE); mkdocs build
# Generate social cards (needs Node.js + Puppeteer)
social:
@echo "Generating OG social cards..."
cd .og-generator && npm install --no-fund --no-audit
node .og-generator/generate-all-social-cards.mjs $(BLOG_DIR) $(SOCIAL_DIR) $(BASE_URL)
# Force regenerate all social cards
social-force:
@echo "Forcing full rebuild of OG social cards..."
cd .og-generator && npm install --no-fund --no-audit
node .og-generator/generate-all-social-cards.mjs $(BLOG_DIR) $(SOCIAL_DIR) $(BASE_URL) --force
# Clean
clean:
rm -rf $(VENV) site docs/assets/social/*.png