astwerk

7. A locale

A locale's subtree is derived from the base tree — you never write the site twice. One line mounts a German mirror of everything:

go
return ssg.BuildLocales(root, []ssg.Locale{{Code: "de"}})

Rebuild and every page exists under /de/ too, rendered by the same components with prefix set to /de — nav links and <html lang> included. The Override map is for the pages that genuinely differ; everything else is mirrored on its own. See Locales & i18n.

Here is that switcher, live — built with the x markers from the next step:

My Site — A portfolio built with astwerk.

Meine Seite — Ein Portfolio, gebaut mit astwerk.

Try it. Add a second locale — say fr — with one overridden page.

What you should see

A French mirror of the whole site appears under /fr/ — pages you didn't override are rendered by the same components with prefix set to /fr.

Where does a locale's subtree come from?

What does the Override map list?