From f5d32f6032ea172d0f1076b1fa04c96c9205285b Mon Sep 17 00:00:00 2001 From: Jieiku Date: Tue, 26 Sep 2023 18:46:53 -0700 Subject: i18n translation system refactor --- templates/macros/macros.html | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) (limited to 'templates/macros') diff --git a/templates/macros/macros.html b/templates/macros/macros.html index d5ea391..d0ce1a0 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,3 +1,7 @@ +{%- macro translate(key, i18n="", default="") %} +{{- i18n[key] | default(value=default) | safe -}} +{%- endmacro %} + {%- macro page_listing(page, config) %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -7,6 +11,15 @@ {%- endmacro page_listing %} +{%- macro series_link(inner, page) %} + {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} + {%- if inner.content == page.content %} +