From 2d0788c3981328f1fbd9de4274d2925bf9586e03 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 22 May 2023 22:39:16 -0700 Subject: Add multi-lingual Support --- templates/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'templates/index.html') diff --git a/templates/index.html b/templates/index.html index 4702e16..84314b1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -54,11 +54,15 @@ {%- endfor %} {{- macros::pagination(paginator=paginator, config=config) }} + {%- if lang == config.default_language %} {%- set section_item = get_section(path="_index.md") %} + {%- else %} + {%- set section_item = get_section(path="_index." ~ lang ~ ".md") %} + {%- endif %} {%- if config.extra.recent | default(value=true) %}
-

Recent Posts

+

{%- if lang != config.default_language %}{{ trans(key="Recent_Posts" | safe, lang=lang) }}{% else %}Recent Posts{% endif %}

{%- set recent_items=config.extra.recent_items | default(value=9) -%} {%- for page in section_item.pages | slice(end=recent_items) %} {{- page_macros::page_listing(page=page, config=config) }} -- cgit v1.3.1