From 41df4a75defc1a62fd57e3372dc6e8afdf983201 Mon Sep 17 00:00:00 2001 From: Adrian Friedli Date: Mon, 30 Apr 2018 23:46:03 +0200 Subject: [PATCH] fix ordinal numbers for english dates --- content/cfp.en.md | 4 ++-- content/infos.en.md | 4 ++-- layouts/shortcodes/cosin_humanize.html | 2 ++ themes/cosin-theme/layouts/partials/site-sidebar.en.html | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 layouts/shortcodes/cosin_humanize.html diff --git a/content/cfp.en.md b/content/cfp.en.md index ba664f7..921a1a5 100644 --- a/content/cfp.en.md +++ b/content/cfp.en.md @@ -19,8 +19,8 @@ learn new stuff and have fun. ## When and Where is CoSin? This year's CoSin takes place from -{{< cosin_i18n "date_start_weekday" >}}, {{< cosin_i18n "date_start_month" >}} {{< cosin "date_start_day" >}}th until -{{< cosin_i18n "date_end_weekday" >}}, {{< cosin_i18n "date_end_month" >}} {{< cosin "date_end_day" >}}th +{{< cosin_i18n "date_start_weekday" >}}, {{< cosin_i18n "date_start_month" >}} {{< cosin_humanize "date_start_day" >}} until +{{< cosin_i18n "date_end_weekday" >}}, {{< cosin_i18n "date_end_month" >}} {{< cosin_humanize "date_end_day" >}} {{< cosin "date_year" >}} {{< cosin_i18n "location_name_preposition" >}} [{{< cosin_i18n "location_name" >}}]({{< cosin "location_url" >}}) in {{< cosin_i18n "location_city" >}}. diff --git a/content/infos.en.md b/content/infos.en.md index f7b1ec6..92caad7 100644 --- a/content/infos.en.md +++ b/content/infos.en.md @@ -10,8 +10,8 @@ menu: ## Date CoSin {{< cosin "date_year" >}} takes place from -{{< cosin_i18n "date_start_weekday" >}}, {{< cosin_i18n "date_start_month" >}} {{< cosin "date_start_day" >}}th until -{{< cosin_i18n "date_end_weekday" >}}, {{< cosin_i18n "date_end_month" >}} {{< cosin "date_end_day" >}}th +{{< cosin_i18n "date_start_weekday" >}}, {{< cosin_i18n "date_start_month" >}} {{< cosin_humanize "date_start_day" >}} until +{{< cosin_i18n "date_end_weekday" >}}, {{< cosin_i18n "date_end_month" >}} {{< cosin_humanize "date_end_day" >}} {{< cosin "date_year" >}}. ## Cost diff --git a/layouts/shortcodes/cosin_humanize.html b/layouts/shortcodes/cosin_humanize.html new file mode 100644 index 0000000..48720fa --- /dev/null +++ b/layouts/shortcodes/cosin_humanize.html @@ -0,0 +1,2 @@ +{{ $value := index .Site.Data.cosin (.Get 0) }} +{{- humanize $value -}} diff --git a/themes/cosin-theme/layouts/partials/site-sidebar.en.html b/themes/cosin-theme/layouts/partials/site-sidebar.en.html index 1af1509..bb2e83e 100644 --- a/themes/cosin-theme/layouts/partials/site-sidebar.en.html +++ b/themes/cosin-theme/layouts/partials/site-sidebar.en.html @@ -10,7 +10,7 @@

{{ if .date_known }} - Date: {{ i18n .date_start_month }} {{ .date_start_day }}th - {{ i18n .date_end_month }} {{ .date_end_day }}th {{ .date_year }}
+ Date: {{ i18n .date_start_month }} {{ humanize .date_start_day }} - {{ i18n .date_end_month }} {{ humanize .date_end_day }} {{ .date_year }}
{{ end }} {{ if .location_known }}