From 3bedb42b0b8ef06967eecaa63b8faa82dbe9cd00 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sun, 8 Aug 2021 10:28:31 +0200 Subject: [PATCH] Fix languages docs Closes #1567 --- .../getting-started/configuration.md | 39 ++++++++++--------- .../documentation/templates/overview.md | 2 +- test_site_i18n/config.toml | 4 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/content/documentation/getting-started/configuration.md b/docs/content/documentation/getting-started/configuration.md index c94f9e7c..8b4bd034 100644 --- a/docs/content/documentation/getting-started/configuration.md +++ b/docs/content/documentation/getting-started/configuration.md @@ -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: diff --git a/docs/content/documentation/templates/overview.md b/docs/content/documentation/templates/overview.md index 6009df25..c40bc35b 100644 --- a/docs/content/documentation/templates/overview.md +++ b/docs/content/documentation/templates/overview.md @@ -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 diff --git a/test_site_i18n/config.toml b/test_site_i18n/config.toml index 30f6aaf9..ea81cd4d 100644 --- a/test_site_i18n/config.toml +++ b/test_site_i18n/config.toml @@ -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]