zola/docs/content/documentation/content/multilingual.md
photong 51d4b6bd6a Simple clean up of documentation. (#849)
* Update installation.md

* Update cli-usage.md

* Update installation.md

* Update directory-structure.md

* Update configuration.md

* Update overview.md

* Update section.md

* Update page.md

* Update section.md

* Update configuration.md

* Update page.md

* Update section.md

* Update page.md

* Update shortcodes.md

* Update linking.md

* Update table-of-contents.md

* Update syntax-highlighting.md

* Update taxonomies.md

* Update search.md

* Update sass.md

* Update index.md

* Update multilingual.md

* Update overview.md

* Update pages-sections.md

* Update pagination.md

* Update taxonomies.md

* Update rss.md

* Update sitemap.md

* Update robots.md

* Update 404.md

* Update archive.md

* Update overview.md

* Update installing-and-using-themes.md

* Update creating-a-theme.md

* Update netlify.md

* Update github-pages.md

* Update gitlab-pages.md

* Update index.md

* Update page.md

* Update section.md

* Updates.
2020-02-02 17:48:42 -08:00

1.3 KiB

+++ 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:

languages = [
    {code = "fr", rss = true}, # there will be a RSS feed for French content
    {code = "fr", search = true}, # there will be a Search Index for French content
    {code = "it"}, # there won't be a RSS feed for Italian content
]

If you want to use per-language taxonomies, ensure you set the lang field in their configuration.

Content

Once the languages have been added, 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 an _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 this is if you are setting a translated page path directly in the front matter.