feat: support multilingual sites
This commit is contained in:
@ -2,9 +2,14 @@
|
||||
|
||||
{% block content -%}
|
||||
|
||||
{% set ext = "" -%}
|
||||
{% if config.default_language != lang -%}
|
||||
{% set ext = "." ~ lang -%}
|
||||
{% endif -%}
|
||||
|
||||
{% set sections = [] -%}
|
||||
{% for section in config.extra.sections | default(value=[]) -%}
|
||||
{% set_global sections = sections | concat(with=get_section(path=section ~ "/_index.md")) -%}
|
||||
{% set_global sections = sections | concat(with=get_section(path=section ~ "/_index" ~ ext ~ ".md")) -%}
|
||||
{% endfor -%}
|
||||
|
||||
<div id="particles" class="fullflex"></div>
|
||||
@ -12,14 +17,24 @@
|
||||
<div id="landing" class="fullflex">
|
||||
<div id="splash">
|
||||
|
||||
<div id="lang">
|
||||
{%- for lang,tr in config.languages %}
|
||||
{% if config.default_language != lang -%}
|
||||
{% set url = config.base_url ~ "/" ~ lang -%}
|
||||
{% endif -%}
|
||||
{% if not loop.first %}| {% endif -%}
|
||||
<a href="{{ url | default(value=config.base_url | safe) }}">{{ tr.translations.flag | default(value=lang) }}</a>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
|
||||
<h1 id="name">
|
||||
{{ macro::format_name(name=config.extra.name) }}
|
||||
</h1>
|
||||
|
||||
{% if config.extra.roles -%}
|
||||
{% if section.extra.roles -%}
|
||||
<div id="roles">
|
||||
<p>
|
||||
{% for role in config.extra.roles -%}
|
||||
{%- for role in section.extra.roles %}
|
||||
<span>{{ role }}</span><br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
Reference in New Issue
Block a user