From 30ac449de6608eb974e4913036030873cedc2f01 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 18 May 2023 20:33:08 +0200 Subject: [PATCH] Wijzigingen voor inbouwen ondersteuning Schema.org-structuren --- themes/nluug/layouts/partials/head.html | 8 +-- .../schemas/include-relevant-schemas.html | 12 ++++ .../partials/schemas/schema_Organization.html | 8 +++ .../partials/schemas/schema_Person.html | 57 +++++++------------ .../partials/schemas/schema_WebSite.html | 4 +- 5 files changed, 42 insertions(+), 47 deletions(-) create mode 100644 themes/nluug/layouts/partials/schemas/include-relevant-schemas.html create mode 100644 themes/nluug/layouts/partials/schemas/schema_Organization.html diff --git a/themes/nluug/layouts/partials/head.html b/themes/nluug/layouts/partials/head.html index bbde381..1b17134 100644 --- a/themes/nluug/layouts/partials/head.html +++ b/themes/nluug/layouts/partials/head.html @@ -15,11 +15,5 @@ {{ partialCached "style.html" . }} - {{ if .IsHome -}} - {{ partial "schemas/schema_WebSite.html" . }} - {{- else if .IsPage -}} - {{ if or (in .Params.content_types "Person") }} - {{ partial "schemas/schema_Person.html" . }} - {{ end }} - {{ end }} + {{ partial "schemas/include-relevant-schemas.html" . }} diff --git a/themes/nluug/layouts/partials/schemas/include-relevant-schemas.html b/themes/nluug/layouts/partials/schemas/include-relevant-schemas.html new file mode 100644 index 0000000..ce66cb7 --- /dev/null +++ b/themes/nluug/layouts/partials/schemas/include-relevant-schemas.html @@ -0,0 +1,12 @@ +{{ if .IsHome -}} + + {{ partial "schemas/schema_Organization.html" . }} + {{ partial "schemas/schema_WebSite.html" . }} + +{{- else if .IsPage -}} + + {{ if or (in .Params.content_types "Person") }} + {{ partial "schemas/schema_Person.html" . }} + {{ end }} + +{{ end }} diff --git a/themes/nluug/layouts/partials/schemas/schema_Organization.html b/themes/nluug/layouts/partials/schemas/schema_Organization.html new file mode 100644 index 0000000..2260687 --- /dev/null +++ b/themes/nluug/layouts/partials/schemas/schema_Organization.html @@ -0,0 +1,8 @@ + diff --git a/themes/nluug/layouts/partials/schemas/schema_Person.html b/themes/nluug/layouts/partials/schemas/schema_Person.html index e8d394c..791e188 100644 --- a/themes/nluug/layouts/partials/schemas/schema_Person.html +++ b/themes/nluug/layouts/partials/schemas/schema_Person.html @@ -3,62 +3,43 @@ {{ $location := index .Site.Data.location .Site.Params.primarylocation }} {{ end }} diff --git a/themes/nluug/layouts/partials/schemas/schema_WebSite.html b/themes/nluug/layouts/partials/schemas/schema_WebSite.html index 7ec3b2d..4e68451 100644 --- a/themes/nluug/layouts/partials/schemas/schema_WebSite.html +++ b/themes/nluug/layouts/partials/schemas/schema_WebSite.html @@ -5,13 +5,13 @@ { "@context": "https://schema.org", "@type": "Webpage", - "specialty": "{{ .Site.Params.description | default .Site.Params.textNoTitle }}", + "specialty": "{{ .Site.Params.description | default .Site.Params.textEmptyValue }}", "mainContentOfPage": { "@context": "https://schema.org/", "@type": "WebPageElement", "cssSelector": ".body-contentTODO" }, - "primaryImageOfPage": "{{ .Site.Params.imageurl | absURL }}" + "primaryImageOfPage": "{{ .Site.Params.imageurl | absURL | default .Site.Params.textEmptyValue }}" }, { "@context": "https://schema.org",