7
0
Fork 0

Aanvullen sameAs met social media en indien van toepassing persoonlijke website

This commit is contained in:
Michael Boelen 2023-06-23 11:40:47 +02:00
parent b6b7317e57
commit c8ef81fc80

View file

@ -1,8 +1,31 @@
{{ $author := index .Site.Data.personen (substr $.File.LogicalName 0 -3) }}
{{ $location := index .Site.Data.location .Site.Params.primarylocation }}
{{ $sameas := slice }}
{{ if $author.sameas }}{{ $sameas = $sameas | append ($author.sameas) }}{{ end }}
{{ if $author.websites }}
{{ range index ($author.websites) }}
{{ if eq .sameas true }}
{{ $sameas = $sameas | append (.url) }}
{{ end }}
{{ end }}
{{ end }}
{{ if $author.social }}
{{ if $author.social.github }}
{{ $sameas = $sameas | append (printf "https://github.com/%s" $author.social.github) }}
{{ end }}
{{ if $author.social.linkedin }}
{{ $sameas = $sameas | append ($author.social.linkedin) }}
{{ end }}
{{ if $author.social.mastodon }}
{{ $sameas = $sameas | append ($author.social.mastodon_url) }}
{{ end }}
{{ if $author.social.twitter }}
{{ $sameas = $sameas | append (printf "https://twitter.com/%s" $author.social.twitter) }}
{{ end }}
{{ end }}
<script type="application/ld+json">
{
"@context": "https://www.schema.org",
"@context": "https://schema.org",
"@type": "Person",
"@id": "{{ .Permalink }}#person",
"url": "{{ .Permalink }}",
@ -11,7 +34,9 @@
"affiliation": [
{
"@type": "Organization",
"name": "{{ $.Site.Params.organization_name | default .Site.Params.textEmptyValue }}",
"id": "{{ .Site.BaseURL }}#organization",
"url": "{{ .Site.BaseURL }}",
"name": "{{ .Site.Title }}",
"sameAs": {{ .Site.Params.organization_sameas }}
}
],
@ -27,7 +52,9 @@
}
],
{{ end }}
{{ if $author.sameas }}"sameAs": "{{ $author.sameas }}",{{ end }}
{{ if $sameas }}
"sameAs": [{{ range $i, $e := $sameas }}{{ if $i }}, {{ end }}"{{ $e }}"{{ end }}],
{{ end }}
{{ if $author.address }}
"address": {
"@type": "PostalAddress",
@ -41,6 +68,10 @@
"@id": "{{ .Permalink }}#profilepage",
"url": "{{ .Permalink }}",
"name": "{{ .Title }}",
"mainContentOfPage": {
"@type": "WebPageElement",
"cssSelector": ".content"
},
"speakable": {
"@type": "SpeakableSpecification",
"cssSelector": ".speakable"