-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
159 lines (123 loc) · 4.84 KB
/
Copy pathJustfile
File metadata and controls
159 lines (123 loc) · 4.84 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Justfile - Task runner for landerox.github.io
default:
@just --list
# =============================================================================
# Development
# =============================================================================
# Start EN dev server (alias for serve-en)
serve: serve-en
# Synchronize Spanish assets from English assets (maintains DRY in Git, copies for Zensical)
sync-assets:
#!/usr/bin/env bash
set -euo pipefail
echo "Synchronizing bilingual assets..."
mkdir -p content/es/assets/images
rm -rf content/es/assets/stylesheets
rm -rf content/es/assets/javascripts
rm -rf content/es/assets/fonts
cp -r content/en/assets/stylesheets content/es/assets/stylesheets
cp -r content/en/assets/javascripts content/es/assets/javascripts
cp -r content/en/assets/fonts content/es/assets/fonts
cp content/en/assets/images/logo.svg content/es/assets/images/logo.svg
cp content/en/assets/images/favicon.svg content/es/assets/images/favicon.svg
cp content/en/assets/images/profile.webp content/es/assets/images/profile.webp
cp content/en/assets/images/banner.svg content/es/assets/images/banner.svg
# EN dev server at http://127.0.0.1:8000
serve-en: sync-assets
uv run zensical serve -f zensical.toml
# ES dev server at http://127.0.0.1:8001
serve-es: sync-assets
uv run zensical serve -f zensical.es.toml -a localhost:8001
# Build EN + ES into site/
build: build-en build-es
# GitHub Pages serves /404.html for any unresolved path and is
# locale-agnostic, so a copy of the EN 404 would show in English
# even under /es/*. Replace Zensical's generic 404.html with a
# tiny router that forwards /es/* errors to /es/404/ and everything
# else to /404/. See .config/404-router.html.
@cp .config/404-router.html site/404.html
uv run python3 scripts/post_build.py
# Build EN site (clears site/ first)
build-en: sync-assets
uv run zensical build -f zensical.toml --clean
# Build ES site into site/es/
build-es: sync-assets
uv run zensical build -f zensical.es.toml --clean
# Remove site/ and Python caches
clean:
rm -rf .cache site .ruff_cache .pytest_cache
# Clean caches and rebuild EN + ES
rebuild: clean build
# =============================================================================
# Quality Assurance
# =============================================================================
# Run all pre-commit hooks across the repo
lint:
uv run pre-commit run --all-files
# Run ESLint on JavaScript files
lint-js:
uv run pre-commit run eslint --all-files
# Run Stylelint on CSS files
lint-css:
uv run pre-commit run stylelint --all-files
# Audit Python deps for known vulnerabilities (pip-audit)
audit:
#!/usr/bin/env bash
set -euo pipefail
req=$(mktemp -t pip-audit-XXXXXX.txt)
trap 'rm -f "$req"' EXIT
uv export --frozen --format requirements-txt --no-dev --output-file "$req"
# PYSEC-2026-89: not applicable to build-time static-site usage.
# See exposure assessment in the commit introducing this flag.
uv run pip-audit --requirement "$req" --ignore-vuln PYSEC-2026-89
# Run cspell on all files
spell:
uv run pre-commit run cspell --all-files
# Validate outbound links in content/ with lychee
links:
lychee --config .config/lychee.toml content/
# =============================================================================
# Dependencies
# =============================================================================
# Install / refresh dependencies from uv.lock
sync:
uv sync --all-groups
# Upgrade lockfile and sync
update:
uv lock --upgrade
uv sync --all-groups
# List outdated dependencies
outdated:
uv tree --outdated
# =============================================================================
# Git Hooks
# =============================================================================
# Install git hooks (pre-commit + commit-msg)
hooks-install:
uv run pre-commit install
# Update hook revs to latest tags
hooks-update:
uv run pre-commit autoupdate
# Uninstall git hooks
hooks-uninstall:
uv run pre-commit uninstall
# =============================================================================
# Security
# =============================================================================
# Pin all GitHub Actions references to SHAs (rerun after editing workflows)
pin-actions:
pinact run
# =============================================================================
# Utilities
# =============================================================================
# Show dependency tree
tree:
uv tree
# Open EN dev server in browser
open:
xdg-open http://127.0.0.1:8000 2>/dev/null || open http://127.0.0.1:8000
# Conventional commit (commitizen guided)
commit:
uv run cz commit
# Trigger deploy.yml paths filter
# (Forces GitHub Actions to recognize a real file modification on push)