# Local preview

How to build the site from `content/` and preview it on your machine, so you
can see blog / news / event changes before they go live.

## 1. Build

From the repo root:

```sh
python tools/build_site.py
```

This runs the whole pipeline in order (renders detail pages from `content/`,
rebuilds the News hub + homepage, injects SEO + sitemap, regenerates the
bot-discovery files, and rebuilds the offline search index). Any failing step
aborts the build, so a broken step never produces half-built output.

Options:

```sh
python tools/build_site.py --check    # verify pages match content/, write nothing
python tools/build_site.py --images    # also convert new images to WebP + fix refs
```

The build is **idempotent** — running it again with no content change produces
no file changes.

## 2. Preview

Serve the repo root over HTTP (opening the files directly with `file://` breaks
absolute paths and the language switcher):

```sh
python -m http.server 8000
```

Then open:

- English: <http://localhost:8000/en/>
- Македонски: <http://localhost:8000/mk/>
- Slovenščina: <http://localhost:8000/si/>

Blog / news / event pages live under, e.g.,
`http://localhost:8000/en/blog/<slug>/`.

## 3. Requirements

Python 3 with `beautifulsoup4`, `pyyaml`, and `Pillow` (only needed for
`--images`):

```sh
python -m pip install beautifulsoup4 pyyaml pillow
```

## Notes

- `content/` is the **source of truth** for blog/news/events; the detail pages
  under `en|mk|si/{blog,news,projects}/` are build output. Edit content in
  `content/` (or, once it is wired up, the CMS), not the generated pages.
- See `docs/content-model.md` for the front-matter schema and
  `docs/plans/2026-08-08-001-feat-no-code-cms-plan.md` for the overall design.
