zola/docs/content/documentation/content/multilingual.md

38 lines
1.2 KiB
Markdown
Raw Normal View History

2018-12-28 12:24:49 +00:00
+++
title = "Multilingual sites"
weight = 130
+++
Zola supports having a site in multiple languages.
## Configuration
To get started, you will need to add the languages you want to support
to your `config.toml`. For example:
```toml
languages = [
{code = "fr", rss = true}, # there will be a RSS feed for French content
{code = "it"}, # there won't be a RSS feed for Italian content
]
```
2019-01-07 20:03:34 +00:00
If you want to use per-language taxonomies, ensure you set the `lang` field in their
configuration.
2018-12-28 12:24:49 +00:00
## Content
Once the languages are added in, you can start to translate your content. Zola
uses the filename to detect the language:
- `content/an-article.md`: this will be the default language
- `content/an-article.fr.md`: this will be in French
If the language code in the filename does not correspond to one of the languages configured,
an error will be shown.
If your default language has an `_index.md` in a directory, you will need to add a `_index.{code}.md`
file with the desired front-matter options as there is no language fallback.
## Output
Zola outputs the translated content with a base URL of `{base_url}/{code}/`.
The only exception to that is if you are setting a translated page `path` directly in the front-matter.