2.2 KiB
2.2 KiB
Repository Guidelines
Project Structure & Module Organization
- Root HTML:
index.html,about.html,privacy.html,terms.html, etc. assets/: site resourcesassets/js/main.js,assets/js/config.jsassets/css/style.cssassets/images/,assets/icons/
og-service/: Go service generating Open Graph share pages (/share) and images (/og) with aMakefileandREADME.md.
Build, Test, and Development Commands
- Static site (serve locally):
python3 -m http.server 8000in repo root, then openhttp://localhost:8000/. - OG service:
cd og-service && make run— run onPORT(default8090).cd og-service && make build— build toog-service/bin/portfoliojournal-og.cd og-service && make clean— remove build artifacts.
Coding Style & Naming Conventions
- HTML/CSS: 2-space indent; semantic markup; class names kebab-case.
- JavaScript: 2-space indent, semicolons, camelCase for variables/functions; avoid new globals (use
CONFIGand module patterns). - Go: follow
gofmt; keep functions small, cohesive; prefer explicit names.
Testing Guidelines
- No unit tests in repo; validate manually.
- Static site: verify navigation highlighting, dark mode toggle, cookie notice, and lazy-loaded images.
- OG service quick check:
DATA='{"n":"Car","r":12500,"g":20000,"c":"USD","td":"2026-12-31"}'ENC=$(python3 - <<'PY'\nimport base64,sys;print(base64.urlsafe_b64encode(sys.stdin.read().encode()).decode().rstrip('='))\nPY <<< "$DATA")curl "http://localhost:8090/share?data=$ENC"curl -o og.png "http://localhost:8090/og?data=$ENC"
Commit & Pull Request Guidelines
- Commits: concise, imperative subjects (e.g.,
fix: correct dark mode label). Conventional Commits encouraged. - PRs: clear description, linked issues, before/after screenshots for UI, local test steps (site + OG endpoints), and any config changes noted.
Security & Configuration Tips
- Edit
assets/js/config.jsfor site metadata; keepENABLE_ANALYTICSfalse unless configured. og-servicereadsPORT; deploy behind a reverse proxy (seeog-service/README.md).- Do not commit secrets; use system service file
og-service/portfoliojournal-og.openrcfor Alpine/OpenRC setups.