Multilingual site π
In this tutorial, you will add a Bosnian translation to the site from the Quickstart.
Set the default language π
Create _config.yaml in the site root:
lang: en
Files directly inside content/ now represent the English site.
Add the translated home page π
Create content/bs/index.md:
---
title: PoΔetna
description: Moja prva Flatmark stranica
---
# Zdravo, Flatmark!
Ova stranica je generisana iz Markdown dokumenta.
The site has this structure:
my-site/
βββ _config.yaml
βββ content/
βββ index.md
βββ bs/
βββ index.md
Preview both languages π
Run:
flatmark serve
Open http://localhost:5555 for the English page and http://localhost:5555/bs/ for the Bosnian page. The default theme displays a language switcher linking the two versions.
Add matching pages π
Create content/about.md:
# About
Then create its translation at content/bs/about.md:
# O nama
Open http://localhost:5555/about.html and use the language switcher. It links to /bs/about.html because Flatmark matches translations by their path relative to the default-language or language-code folder.
The completed structure matches the multilingual example.