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:
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.
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?
BuildLocales mirrors the base tree under the locale's prefix; Override lists only the pages that genuinely differ.
What does the Override map list?
Everything not named in Override is mirrored automatically; Override patches only the nodes that genuinely differ — the default is the same site.