@ -268,7 +268,7 @@ The current language's index page lies in {{ macros::i18n_page(path="_index.md")
#### Structure
index.html is the main template that gets rendered for everypage. It defines the current language and renders the global page skeleton accordingly. In addition, it defines a few blocks that are overriden by children templates:
index.html is the main template that gets rendered for everypage. It renders the global page skeleton according to the language requested. In addition, it defines a few blocks that are overriden by children templates:
- title: the raw page title
- main: the main content
@ -307,8 +307,6 @@ You can then summon this menu like this:
{{ widgets::menu(content="menu.md") }}
```
If a `lang` variable is defined in the current context, the macro will automatically find the localized page for the menu.
#### Translations in templates
##### Localized string
@ -319,7 +317,7 @@ If you want to use a translation string defined in the translations section of t
{{ trans(key="readmore", lang=lang) }}
```
The lang variable is conveniently set for you at the top of index.html template so all templates which extend index.html should have it.
Conveniently, the `lang` variable is automatically set by Zola in most contexts.
##### Localized path
@ -330,8 +328,6 @@ In case you need to interact with a localized page, you will need to replace the
{{ widgets::i18n_path(path="@/blog/_index.md") }}
```
If the `lang` variable is set in the context, the corresponding path will be returned.
##### Localized page content
If you wish to directly extract the contents of a localized page, without any regards to its frontmatter, you can use the i18n_content macro:
@ -341,8 +337,6 @@ If you wish to directly extract the contents of a localized page, without any re
If the `lang` variable is set in the context, the corresponding page's content will be returned.
##### Localized URL
If you need to get the localized URI for path on the website, you can use the i18n_url macro which acts as a wrapper around the [get_url](https://www.getzola.org/documentation/templates/overview/#get-url) function:
@ -352,8 +346,6 @@ If you need to get the localized URI for path on the website, you can use the i1