From 809f53f80fb978e8862d6d53487a88a476e79bb0 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Fri, 23 Jun 2023 16:26:55 +0200 Subject: [PATCH] Toevoegen Article en uitbreiden WebPage --- .../schemas/include-relevant-schemas.html | 6 ++- .../partials/schemas/schema_Article.html | 54 +++++++++++++++++++ .../partials/schemas/schema_WebPage.html | 19 +++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 themes/nluug/layouts/partials/schemas/schema_Article.html diff --git a/themes/nluug/layouts/partials/schemas/include-relevant-schemas.html b/themes/nluug/layouts/partials/schemas/include-relevant-schemas.html index 713743f..4848424 100644 --- a/themes/nluug/layouts/partials/schemas/include-relevant-schemas.html +++ b/themes/nluug/layouts/partials/schemas/include-relevant-schemas.html @@ -11,7 +11,11 @@ {{ else if in .Params.content_types "person" }} {{ partial "schemas/schema_Person.html" . }} {{ else }} - {{ partial "schemas/schema_WebPage.html" . }} + {{ if gt .WordCount 100 }} + {{ partial "schemas/schema_Article.html" . }} + {{ else }} + {{ partial "schemas/schema_WebPage.html" . }} + {{ end }} {{ end }} {{- else if .IsSection -}} diff --git a/themes/nluug/layouts/partials/schemas/schema_Article.html b/themes/nluug/layouts/partials/schemas/schema_Article.html new file mode 100644 index 0000000..433471b --- /dev/null +++ b/themes/nluug/layouts/partials/schemas/schema_Article.html @@ -0,0 +1,54 @@ + diff --git a/themes/nluug/layouts/partials/schemas/schema_WebPage.html b/themes/nluug/layouts/partials/schemas/schema_WebPage.html index 7022c37..ae51caf 100644 --- a/themes/nluug/layouts/partials/schemas/schema_WebPage.html +++ b/themes/nluug/layouts/partials/schemas/schema_WebPage.html @@ -7,6 +7,25 @@ "datePublished": {{ .Date }}, "dateModified": {{ .Lastmod }}, "inLanguage": "{{ .Site.LanguageCode }}", + {{ if .Params.review.reviewed_by }} + {{ if findRE `^[a-z]+(\-[a-z]+)+$` .Params.review.reviewed_by 1 }} + {{ with (index $.Site.Data.personen .Params.review.reviewed_by) }} + "reviewedBy": { + "@type": "Person", + "name": "{{ .name }}", + "sameAs": "{{ .profile_page | absURL }}" + }, + {{ end }} + {{ else }} + "reviewedBy": { + "@type": "Person", + "name": "{{ .Params.review.reviewed_by }}" + }, + {{ end }} + {{ end }} + {{ if .Params.review.last_review }} + "lastReviewed": "{{ .Params.review.last_review }}", + {{ end }} "mainContentOfPage": { "@type": "WebPageElement", "cssSelector": ".content"