Fix languages docs

Closes #1567
This commit is contained in:
Vincent Prouillet 2021-08-08 10:28:31 +02:00
parent e2f2f4f779
commit 3bedb42b0b
3 changed files with 23 additions and 22 deletions

View File

@ -18,7 +18,8 @@ Here are the current `config.toml` sections:
4. slugify
5. search
6. translations
7. extra
7. languages
8. extra
**Only the `base_url` variable is mandatory**. Everything else is optional. All configuration variables
used by Zola as well as their default values are listed below:
@ -72,27 +73,17 @@ feed_filename = "atom.xml"
# files are always copied, regardless of this setting.
hard_link_static = false
# The taxonomies to be rendered for the site and their configuration.
# The taxonomies to be rendered for the site and their configuration of the default languages
# Example:
# taxonomies = [
# {name = "tags", feed = true}, # each tag will have its own feed
# {name = "tags", lang = "fr"}, # you can have taxonomies with the same name in multiple languages
# {name = "tags"}, # you can have taxonomies with the same name in multiple languages
# {name = "categories", paginate_by = 5}, # 5 items per page for a term
# {name = "authors"}, # Basic definition: no feed or pagination
# ]
#
taxonomies = []
# The additional languages for the site.
# Example:
# languages = [
# {code = "fr", feed = true}, # there will be a feed for French content
# {code = "fr", search = true}, # there will be a Search Index for French content
# {code = "it"}, # there won't be a feed for Italian content
# ]
#
languages = []
# A list of directories used to search for additional `.sublime-syntax` files.
extra_syntaxes = []
@ -159,20 +150,30 @@ include_content = true
# become too big to load on the site. Defaults to not being set.
# truncate_content_length = 100
# Optional translation object. Keys should be language codes.
# Optional translation object. The key if present should be a language code.
# Optional translation object for the default language
# Example:
# default_language = "fr"
#
# [translations]
# [translations.fr]
# title = "Un titre"
#
# [translations.en]
# title = "A title"
#
[translations]
# Additional languages definition
# You can define language specific config values and translations:
# title, description, generate_feed, feed_filename, taxonomies, build_search_index
# as well as its own search configuration and translations (see above for details on those)
[languages]
# For example
# [languages.fr]
# title = "Mon blog"
# generate_feed = true
# taxonomies = [
# {name = "auteurs"},
# {name = "tags"},
# ]
# build_search_index = false
# You can put any kind of data here. The data
# will be accessible in all templates
# Example:

View File

@ -15,7 +15,7 @@ you can place `{{ __tera_context }}` in the template to print the whole context.
A few variables are available on all templates except feeds and the sitemap:
- `config`: the [configuration](@/documentation/getting-started/configuration.md) without any modifications
- `config`: the language aware [configuration](@/documentation/getting-started/configuration.md)
- `current_path`: the path (full URL without `base_url`) of the current page, always starting with a `/`
- `current_url`: the full URL for the current page
- `lang`: the language for the current page

View File

@ -19,8 +19,8 @@ taxonomies = [
[languages.fr]
generate_feed = true
taxonomies = [
{name = "auteurs", lang = "fr"},
{name = "tags", lang = "fr"},
{name = "auteurs"},
{name = "tags"},
]
[languages.it]