mirror of
https://github.com/rjNemo/vf-site
synced 2026-06-10 11:16:38 +00:00
2.3 KiB
2.3 KiB
Repository Guidelines
Project Structure & Modules
lib/: static site generator code —main.py(entry point),config.py,engine.py.pages/: Jinja templates; layouts live inpages/layouts/.data/: page data in TOML; file name must match the template (e.g.,index.toml→index.html).assets/: static files copied as‑is (css/,js/,images/,webfonts/).dist/: build output (generated, can be deleted/rebuilt).config.toml: required; at minimumname = "VillaFleurie".
Build, Test, and Development
make build: renders templates intodist/(pipenv run python -m lib.main).make run: builds then servesdist/viahttp.server.make lint: format (black), lint/fix (ruff), and type‑check (mypy).- Direct run:
pipenv run python -m lib.main. - Setup:
pipenv install --dev(Python 3.11).
Coding Style & Naming
- Python: formatted by
black(120 cols), imports viaisort(black profile), linted byruff; type hints required (mypywithdisallow_untyped_defs). - Templates: Jinja; use inheritance with
pages/layouts/. Prefer kebab‑case filenames (e.g.,t3-azur.html). - Data files: TOML mirroring template names (e.g.,
t3-azur.toml). Keep keys lower_snake_case. - Modules: snake_case for Python files and identifiers.
Testing Guidelines
- No formal test suite. Validate changes by:
- Running
make lintand fixing all issues. - Building with
make buildand visually checking pages indist/(make run). - Verifying the correct data file is picked up for each template.
- Running
Commit & Pull Requests
- Use Conventional Commits (seen in history):
- Examples:
refactor(html): modernize header markup,feat(engine): add file watching.
- Examples:
- PRs must:
- Pass
make lintand build cleanly. - Include a clear description, linked issues, and affected pages/files.
- Add screenshots of visual changes (before/after) where relevant.
- Stay focused and small; avoid mixed concerns.
- Pass
Revamp Spec & Branch
- Active branch:
revamp/website-spec. - Source of truth:
docs/spec/website-revamp-spec.md(keep updated in PRs). - Align changes to the agreed sitemap and CTAs defined in the spec.
Configuration Tips
- Ensure
config.tomlexists at repo root; build fails without it. - Do not commit generated
dist/output.