From f8d7dd908c23ed190655d1034afb0c4afe8024e1 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Tue, 23 May 2023 14:50:25 +0200 Subject: [PATCH] Corrigeren ondersteuning voor auteurs, zodat we atom-feed kunnen voorzien van emailadressen en nieuwsberichten van naam --- content/nieuws/2023-05-06-nieuwe-website-in-aanbouw.rst | 2 +- content/nieuws/2023-05-12-uitreiking-award-bert-hubert.md | 2 +- content/nieuws/2023-05-17-wijziging-in-bestuur.md | 2 +- ...05-22-website-nieuwe-functionaliteit-content-review.md | 2 +- data/authors/michael-boelen.yaml | 2 ++ data/authors/patrick-reijnen.yaml | 2 ++ themes/nluug/layouts/index.xml | 7 ++++++- themes/nluug/layouts/posts/news.html | 8 +++++++- 8 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 data/authors/michael-boelen.yaml create mode 100644 data/authors/patrick-reijnen.yaml diff --git a/content/nieuws/2023-05-06-nieuwe-website-in-aanbouw.rst b/content/nieuws/2023-05-06-nieuwe-website-in-aanbouw.rst index f0d549b..deaaf4f 100644 --- a/content/nieuws/2023-05-06-nieuwe-website-in-aanbouw.rst +++ b/content/nieuws/2023-05-06-nieuwe-website-in-aanbouw.rst @@ -1,5 +1,5 @@ --- -author: "Michael Boelen" +author: michael-boelen categories: - nieuws date: 2023-05-06T13:08:32+02:00 diff --git a/content/nieuws/2023-05-12-uitreiking-award-bert-hubert.md b/content/nieuws/2023-05-12-uitreiking-award-bert-hubert.md index ddb5ada..26dcd2e 100644 --- a/content/nieuws/2023-05-12-uitreiking-award-bert-hubert.md +++ b/content/nieuws/2023-05-12-uitreiking-award-bert-hubert.md @@ -1,5 +1,5 @@ --- -author: Patrick Reijnen +author: patrick-reijnen categories: - nieuws date: 2023-05-12T14:56:33+02:00 diff --git a/content/nieuws/2023-05-17-wijziging-in-bestuur.md b/content/nieuws/2023-05-17-wijziging-in-bestuur.md index e83cb58..a8acfc6 100644 --- a/content/nieuws/2023-05-17-wijziging-in-bestuur.md +++ b/content/nieuws/2023-05-17-wijziging-in-bestuur.md @@ -1,5 +1,5 @@ --- -author: "Michael Boelen" +author: michael-boelen categories: - nieuws date: 2023-05-17T14:56:33+02:00 diff --git a/content/nieuws/2023-05-22-website-nieuwe-functionaliteit-content-review.md b/content/nieuws/2023-05-22-website-nieuwe-functionaliteit-content-review.md index c35d52b..4686314 100644 --- a/content/nieuws/2023-05-22-website-nieuwe-functionaliteit-content-review.md +++ b/content/nieuws/2023-05-22-website-nieuwe-functionaliteit-content-review.md @@ -1,5 +1,5 @@ --- -author: Michael Boelen +author: michael-boelen categories: - nieuws date: 2023-05-22T21:06:43+02:00 diff --git a/data/authors/michael-boelen.yaml b/data/authors/michael-boelen.yaml new file mode 100644 index 0000000..7c1d6e1 --- /dev/null +++ b/data/authors/michael-boelen.yaml @@ -0,0 +1,2 @@ +name: Michael Boelen +email: michael@nluug.nl diff --git a/data/authors/patrick-reijnen.yaml b/data/authors/patrick-reijnen.yaml new file mode 100644 index 0000000..6d46aba --- /dev/null +++ b/data/authors/patrick-reijnen.yaml @@ -0,0 +1,2 @@ +name: Patrick Reijnen +email: patrick@nluug.nl diff --git a/themes/nluug/layouts/index.xml b/themes/nluug/layouts/index.xml index 4ccf207..0c1846c 100644 --- a/themes/nluug/layouts/index.xml +++ b/themes/nluug/layouts/index.xml @@ -18,7 +18,12 @@ {{ .Title }} {{ .Permalink }} {{ .Content | plainify }} - {{ .Params.Author | default $author }} + {{- if .Params.Author -}} + {{- $author := index .Site.Data.authors .Params.author -}} + {{ $author.email }} + {{- else -}} + website@nluug.nl + {{- end -}} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} diff --git a/themes/nluug/layouts/posts/news.html b/themes/nluug/layouts/posts/news.html index 8331203..ad92a97 100644 --- a/themes/nluug/layouts/posts/news.html +++ b/themes/nluug/layouts/posts/news.html @@ -4,7 +4,13 @@ {{ $text := .Content }} {{ $date := .Date.Format "02-01-2006" }} {{ $lastmod := .Lastmod.Format "02-01-2006" }} - Gepubliceerd op {{ $date }} door {{ .Params.author | default .Site.Params.author }}.{{ if gt .Params.lastmod .Params.date }} Artikel bijgewerkt op {{ $lastmod }}{{ end }} + {{ if isset .Params "author" }} + {{ $author := index .Site.Data.authors .Params.author }} + Gepubliceerd op {{ $date }} door {{ $author.name }}.{{ if gt .Params.lastmod .Params.date }} Artikel bijgewerkt op {{ $lastmod }}{{ end }} + {{ else }} + {{ $author := .Site.Params.author }} + Gepubliceerd op {{ $date }} door {{ .Site.Params.author }}.{{ if gt .Params.lastmod .Params.date }} Artikel bijgewerkt op {{ $lastmod }}{{ end }} + {{ end }}
{{ $text }} {{ if .Params.signed_by }}{{ .Params.signed_by }}{{ end }}