From 7ebd00c633f447cd9f203d44cb859c66ad71f80a Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 12 Mar 2023 18:20:56 +0100 Subject: [PATCH] Format date using built-in locale-aware formatting --- config.toml | 1 + layouts/index.html | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 5d5efc6..3c0c787 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,5 @@ baseURL = 'https://kontakt-bamberg.de/' +defaultContentLanguage = 'de' languageCode = 'de-de' paginate = 3 title = 'kontakt – Das Kulturprojekt' diff --git a/layouts/index.html b/layouts/index.html index a495217..f8d481e 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,10 +2,8 @@ {{ .Content }}

Aktuelles

{{ $pagination := .Paginate .RegularPages }} -{{ $days := dict "Monday" "Mo" "Tuesday" "Di" "Wednesday" "Mi" "Thursday" "Do" "Friday" "Fr" "Saturday" "Sa" "Sunday" "So" }} -{{ $months := dict "January" "Januar" "February" "Februar" "March" "März" "April" "April" "May" "Mai" "June" "Juni" "July" "Juli" "August" "August" "September" "September" "October" "Oktober" "November" "November" "December" "Dezember" }} {{ range $pagination.Pages }} -

{{ index $days (.Date.Format "Monday") }}, {{ .Date.Format "02" }}. {{ index $months (.Date.Format "January") }} {{ .Date.Format "2006" }}

+

{{ .Date | dateFormat "Mon, 02. January 2006" }}

{{ with .Resources.GetMatch "image.jpg" }}
{{ .Title }}