From 88dd1687077ff4cb06b49acf3dd77613acae319a Mon Sep 17 00:00:00 2001 From: southerntofu Date: Mon, 30 Mar 2020 01:14:14 +0200 Subject: [PATCH] Date formats are localized and i18n has simple macros --- config.toml | 2 ++ templates/index.html | 9 +++------ templates/page.html | 2 +- templates/section.html | 14 ++++---------- templates/widgets.html | 18 +++++++++++++++++- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/config.toml b/config.toml index c87255a..89bb1cd 100644 --- a/config.toml +++ b/config.toml @@ -29,8 +29,10 @@ source = "Source de cette page" readmore = "Lire la suite" previousPage = "Page précédente" nextPage = "Page suivante" +dateFormat = "%d/%m/%Y" [translations.en] source = "Source for this page" readmore = "Read more" previousPage = "Previous page" nextPage = "Next page" +dateFormat = "%m/%d/%Y" diff --git a/templates/index.html b/templates/index.html index 5caede0..91c08eb 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,5 @@ {% import "widgets.html" as widgets %} -{% set lang = section.lang | default(value=page.lang) %}{% if lang == "en" %}{% set lang = false %}{% endif %} +{% set lang = section.lang | default(value=page.lang) %} @@ -14,9 +14,7 @@
{% set header = get_page(path="_common/header.md") %} {{ header.content | markdown | safe }} - {% if lang %}{{ widgets::menu(content="_common/menu." ~ lang ~ ".md") }} - {% else %}{{ widgets::menu(content="_common/menu.md") }} - {% endif %} + {{ widgets::menu(content="_common/menu.md") }}
{% block main %} @@ -28,8 +26,7 @@