You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

multilingual.md 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. +++
  2. title = "Multilingual sites"
  3. weight = 130
  4. +++
  5. Zola supports having a site in multiple languages.
  6. ## Configuration
  7. To get started, you will need to add the languages you want to support
  8. to your `config.toml`. For example:
  9. ```toml
  10. languages = [
  11. {code = "fr", rss = true}, # there will be a RSS feed for French content
  12. {code = "fr", search = true}, # there will be a Search Index for French content
  13. {code = "it"}, # there won't be a RSS feed for Italian content
  14. ]
  15. ```
  16. If you want to use per-language taxonomies, ensure you set the `lang` field in their
  17. configuration.
  18. ## Content
  19. Once the languages are added in, you can start to translate your content. Zola
  20. uses the filename to detect the language:
  21. - `content/an-article.md`: this will be the default language
  22. - `content/an-article.fr.md`: this will be in French
  23. If the language code in the filename does not correspond to one of the languages configured,
  24. an error will be shown.
  25. If your default language has an `_index.md` in a directory, you will need to add a `_index.{code}.md`
  26. file with the desired front-matter options as there is no language fallback.
  27. ## Output
  28. Zola outputs the translated content with a base URL of `{base_url}/{code}/`.
  29. The only exception to that is if you are setting a translated page `path` directly in the front-matter.