mirror of
https://github.com/rjNemo/vf-site
synced 2026-06-12 12:06:39 +00:00
docs: update project structure and usage in docs
Revamps AGENTS.md and README.md to reflect the new Astro/Tailwind app structure, replacing legacy Python generator references. Adds details on locales, route manifest, build/test commands, and contributor guidelines. Clarifies folder usage, i18n, forms, analytics, and phase plan. Removes obsolete instructions and aligns documentation with current development practices.
This commit is contained in:
parent
38452ed5ca
commit
2e9aa1dc31
2 changed files with 54 additions and 66 deletions
67
AGENTS.md
67
AGENTS.md
|
|
@ -2,56 +2,47 @@
|
||||||
|
|
||||||
## Project Structure & Modules
|
## Project Structure & Modules
|
||||||
|
|
||||||
- `lib/`: static site generator code — `main.py` (entry point), `config.py`, `engine.py`.
|
- `src/`: Astro app — `pages/` (locale folders: `fr/`, `en/`), `layouts/`, `styles/`.
|
||||||
- `pages/`: Jinja templates; layouts live in `pages/layouts/`.
|
- `src/i18n/routes.ts`: central route manifest (`hrefFor`, `siblingPath`) for FR/EN slugs.
|
||||||
- `data/`: page data in TOML; file name must match the template
|
- `public/`: static assets and redirects (`_redirects`, `assets/images`, `webfonts`, etc.).
|
||||||
(e.g., `index.toml` → `index.html`).
|
- `docs/spec/website-revamp-spec.md`: product/UX spec and release plan (source of truth).
|
||||||
- `assets/`: static files copied as‑is (`css/`, `js/`, `images/`, `webfonts/`).
|
- Legacy: `lib/`, `pages/`, `data/` (Python generator) — deprecated; do not modify.
|
||||||
- `dist/`: build output (generated, can be deleted/rebuilt).
|
|
||||||
- `config.toml`: required; at minimum `name = "VillaFleurie"`.
|
|
||||||
|
|
||||||
## Build, Test, and Development
|
## Build, Test, and Development
|
||||||
|
|
||||||
- `make build`: renders templates into `dist/` (`pipenv run python -m lib.main`).
|
- Setup: `corepack enable && pnpm i` (uses `pnpm@10`).
|
||||||
- `make run`: builds then serves `dist/` via `http.server`.
|
- Dev server: `pnpm dev` (Astro). Build: `pnpm build`. Preview: `pnpm preview`.
|
||||||
- `make lint`: format (`black`), lint/fix (`ruff`), and type‑check (`mypy`).
|
- Deploy: Netlify (static). Redirects in `public/_redirects` (root → `/fr/`).
|
||||||
- Direct run: `pipenv run python -m lib.main`.
|
- Analytics: Plausible (`plausible("event", {props})`).
|
||||||
- Setup: `pipenv install --dev` (Python 3.11).
|
|
||||||
|
|
||||||
## Coding Style & Naming
|
## Coding Style & Conventions
|
||||||
|
|
||||||
- Python: formatted by `black` (120 cols), imports via `isort` (black profile),
|
- UI: Tailwind CSS v4 (brand tokens: `--color-brand`, `--color-brand-600`).
|
||||||
linted by `ruff`; type hints required (`mypy` with `disallow_untyped_defs`).
|
- Icons: `lucide-astro` inline SVGs; use `text-brand` for accent.
|
||||||
- Templates: Jinja; use inheritance with `pages/layouts/`. Prefer kebab‑case
|
- JS: vanilla only (no jQuery). Prefer lightweight patterns (e.g., scrollBy carousels).
|
||||||
filenames (e.g., `t3-azur.html`).
|
- i18n: use `hrefFor()` and `siblingPath()` for all internal links and language toggles.
|
||||||
- Data files: TOML mirroring template names (e.g., `t3-azur.toml`). Keep keys lower_snake_case.
|
- Content slugs differ by locale (e.g., FR `avis` ↔ EN `reviews`) — never hardcode.
|
||||||
- Modules: snake_case for Python files and identifiers.
|
|
||||||
|
|
||||||
## Testing Guidelines
|
## Testing Guidelines
|
||||||
|
|
||||||
- No formal test suite. Validate changes by:
|
- Sanity: `pnpm build` must succeed. Then `pnpm preview` for visual QA.
|
||||||
- Running `make lint` and fixing all issues.
|
- Check: FR/EN toggles, redirects (`/ → /fr/`), forms (Netlify), and analytics events.
|
||||||
- Building with `make build` and visually checking pages in `dist/` (`make run`).
|
- Accessibility: keyboard nav for mobile menu; color contrast for brand accents.
|
||||||
- Verifying the correct data file is picked up for each template.
|
|
||||||
|
|
||||||
## Commit & Pull Requests
|
## Commit & Pull Requests
|
||||||
|
|
||||||
- Use Conventional Commits (seen in history):
|
- Conventional Commits (examples): `feat(home): hero CTA`, `fix(i18n): toggle sibling path`.
|
||||||
- Examples: `refactor(html): modernize header markup`,
|
- PRs should include: build passing, screenshots (FR/EN), and spec updates when needed.
|
||||||
`feat(engine): add file watching`.
|
- Keep focused and small; avoid mixing refactors with features.
|
||||||
- PRs must:
|
|
||||||
- Pass `make lint` and 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.
|
|
||||||
|
|
||||||
## Revamp Spec & Branch
|
## Revamp Spec & Phases
|
||||||
|
|
||||||
- Active branch: `revamp/website-spec`.
|
- Branch: `revamp/website-spec`. Spec: `docs/spec/website-revamp-spec.md`.
|
||||||
- Source of truth: `docs/spec/website-revamp-spec.md` (keep updated in PRs).
|
- Phase 1 (current): FR core pages, inquiry form, i18n scaffolding.
|
||||||
- Align changes to the agreed sitemap and CTAs defined in the spec.
|
- Phase 2: EN pages + gallery, translated reviews.
|
||||||
|
- Phase 3: Policies, analytics KPIs, performance polish (WebP/srcset, Lighthouse).
|
||||||
|
|
||||||
## Configuration Tips
|
## Notes
|
||||||
|
|
||||||
- Ensure `config.toml` exists at repo root; build fails without it.
|
- Do not commit `dist/`. Assets live in `public/assets/...`.
|
||||||
- Do not commit generated `dist/` output.
|
- Use the route manifest for any new pages/links; add entries for new slugs.
|
||||||
|
|
|
||||||
53
README.md
53
README.md
|
|
@ -1,42 +1,39 @@
|
||||||
# Astro Starter Kit: Minimal
|
# VillaFleurie Website (Astro + Tailwind)
|
||||||
|
|
||||||
```sh
|
This site is built with Astro and Tailwind, with FR/EN locales. The legacy Python generator remains for reference but is deprecated — new work happens in `src/`.
|
||||||
npm create astro@latest -- --template minimal
|
|
||||||
```
|
|
||||||
|
|
||||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
## Quick Start
|
||||||
|
|
||||||
## 🚀 Project Structure
|
- Requirements: Node 18+, Corepack enabled (`pnpm`). Then:
|
||||||
|
- `corepack enable`
|
||||||
|
- `pnpm install`
|
||||||
|
- Dev server: `pnpm dev` → open `http://localhost:4321/fr/` (root redirects to `/fr/`).
|
||||||
|
- Build: `pnpm build` → static output in `dist/`. Preview: `pnpm preview`.
|
||||||
|
|
||||||
Inside of your Astro project, you'll see the following folders and files:
|
## Structure
|
||||||
|
|
||||||
```text
|
- `src/pages/fr|en/`: localized pages (Home, Apartments, Reviews, Rates, Contact, Policies).
|
||||||
/
|
- `src/layouts/`: shared layout with sticky header, language toggle, footer.
|
||||||
├── public/
|
- `src/styles/global.css`: Tailwind v4 with brand tokens (`--color-brand`, `--color-brand-600`).
|
||||||
├── src/
|
- `src/i18n/routes.ts`: route manifest (`hrefFor`, `siblingPath`, `navFor`).
|
||||||
│ └── pages/
|
- `public/`: static assets + `_redirects` (root → `/fr/`).
|
||||||
│ └── index.astro
|
- Spec: `docs/spec/website-revamp-spec.md` (goals, sitemap, copy, release plan).
|
||||||
└── package.json
|
|
||||||
```
|
|
||||||
|
|
||||||
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
## i18n & Navigation
|
||||||
|
|
||||||
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
- Folder-based locales with different slugs (e.g., FR `avis` ↔ EN `reviews`).
|
||||||
|
- Always use the route helpers for links and the language toggle; don’t hardcode cross‑locale paths.
|
||||||
|
|
||||||
Any static assets, like images, can be placed in the `public/` directory.
|
## Forms & Analytics
|
||||||
|
|
||||||
## 🧞 Commands
|
- Netlify Forms on `/fr/contact/` and `/en/contact/`, with localized thank‑you pages.
|
||||||
|
- Plausible events: `booking_request_submitted` (primary), `click_airbnb`, `click_booking`, etc.
|
||||||
|
|
||||||
All commands are run from the root of the project, from a terminal:
|
## Contributing
|
||||||
|
|
||||||
| Command | Action |
|
- Use Conventional Commits. Include screenshots (FR/EN) for UI changes.
|
||||||
| :------------------------ | :----------------------------------------------- |
|
- Keep the spec updated when requirements change.
|
||||||
| `npm install` | Installs dependencies |
|
- See `AGENTS.md` for contributor guidelines and the current phase plan.
|
||||||
| `npm run dev` | Starts local dev server at `localhost:4321` |
|
|
||||||
| `npm run build` | Build your production site to `./dist/` |
|
|
||||||
| `npm run preview` | Preview your build locally, before deploying |
|
|
||||||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
||||||
| `npm run astro -- --help` | Get help using the Astro CLI |
|
|
||||||
|
|
||||||
## 👀 Want to learn more?
|
## 👀 Want to learn more?
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue