1. Order the content
The simplest way is two language folders:
content/
de/
index.md
kaffee.md
en/
index.md
coffee.md
Other ways — file suffixes, a frontmatter field — are in chapter 2.
2. Install the plugin
npx quartz plugin add github:boxi-os/quartz-multilanguage3. Add the entry
plugins:
- source: github:boxi-os/quartz-multilanguage
enabled: true
order: 65
options:
languages:
- { code: de, native: Deutsch, locale: de-DE }
- { code: en, native: English, locale: en-US }
defaultLanguage: de
layout:
position: header
group: toolbarOne entry is enough. The plugin is several things at once — what, is under 1.3; the configuration notices none of it.
4. Look at it
npx quartz build --serveThe switcher sits at the top right. A click leads from de/kaffee to en/coffee — provided the two
are linked. With identical base paths that happens by itself; de/kaffee and en/coffee are named
differently, though, and that needs a hint in the frontmatter:
---
title: Kaffee
translationKey: kaffee
---The same line in en/coffee.md, and the two belong together.
Chapter 3 shows the three ways there.
When something is off
| What you see | What causes it |
|---|---|
| No switcher | Only one language configured — or the page has no translation and switcher.missing: hide is set. |
| The switcher goes to the start page | The pages are not linked. That is the normal case with missing: home. |
| Every page counts as German | detection finds nothing — check the folder names, or defaultLanguage. |
<html lang> is wrong | locale is missing from the language entry; without it the code is used. |