Verdere opmaak van gestructureerde data, aanbrengen onderscheid tussen webpagina's en profielpagina's, markeren content die uitgesproken kan worden

This commit is contained in:
Michael Boelen 2023-06-21 15:34:33 +02:00
parent 3d2a7b3b65
commit 029409826a
6 changed files with 89 additions and 55 deletions

View file

@ -1,42 +1,56 @@
{{ if .Params.slug }}
{{ $author := index .Site.Data.personen .Params.slug }}
{{ $author := index .Site.Data.personen (substr $.File.LogicalName 0 -3) }}
{{ $location := index .Site.Data.location .Site.Params.primarylocation }}
<script type="application/ld+json">
{
"@context": "https://www.schema.org",
"@type": "Person",
"@id": "{{ .Permalink }}",
"name": "{{ $author.name | default .Site.Params.textEmptyValue }}",
{{ if $author.nationality }}"nationality": "{{ $author.nationality }}",{{ end }}
"affiliation": [
{
"@type": "Organization",
"name": "{{ $.Site.Params.organization_name | default .Site.Params.textEmptyValue }}",
"sameAs": {{ .Site.Params.organization_sameas }}
"@context": "https://www.schema.org",
"@type": "Person",
"@id": "{{ .Permalink }}#person",
"url": "{{ .Permalink }}",
"name": "{{ $author.name | default .Site.Params.textEmptyValue }}",
{{ if $author.nationality }}"nationality": "{{ $author.nationality }}",{{ end }}
"affiliation": [
{
"@type": "Organization",
"name": "{{ $.Site.Params.organization_name | default .Site.Params.textEmptyValue }}",
"sameAs": {{ .Site.Params.organization_sameas }}
}
],
{{ if $author.gender }}"gender": "{{ $author.gender }}",{{ end }}
{{ if $author.jobfunction }}"Description": "{{ $author.jobfunction }}",{{ end }}
{{ if $author.description }}"disambiguatingDescription": "{{ $author.description }}",{{ end }}
{{ if $author.jobtitle }}"jobTitle": "{{ $author.jobtitle }}",{{ end }}
{{ if $author.worksfor }}
"worksFor": [
{
"@type": "Organization",
"name": "{{ .Site.Params.name | default .Site.Params.textEmptyValue }}"
}
],
{{ end }}
{{ if $author.sameas }}"sameAs": "{{ $author.sameas }}",{{ end }}
{{ if $author.address }}
"address": {
"@type": "PostalAddress",
"addressLocality": "{{ $author.address.city }}",
"addressRegion": "{{ $author.address.region }}",
"addressCountry": "{{ $author.address.country }}"
},{{ end }}
"image": "{{ $author.thumbnail | absURL }}",
"mainEntityOfPage": {
"@type": "ProfilePage",
"@id": "{{ .Permalink }}#profilepage",
"url": "{{ .Permalink }}",
"name": "{{ .Title }}",
"speakable": {
"@type": "SpeakableSpecification",
"cssSelector": ".speakable"
},
"isPartOf": {
"@type": "WebSite",
"@id": "{{ .Site.BaseURL }}#website",
"url": "{{ .Site.BaseURL }}",
"name": "{{ .Site.Title | default .Site.Params.textNoTitle }}"
}
}
],
{{ if $author.gender }}"gender": "{{ $author.gender }}",{{ end }}
{{ if $author.jobfunction }}"Description": "{{ $author.jobfunction }}",{{ end }}
{{ if $author.description }}"disambiguatingDescription": "{{ $author.description }}",{{ end }}
{{ if $author.jobtitle }}"jobTitle": "{{ $author.jobtitle }}",{{ end }}
{{ if $author.worksfor }}
"worksFor": [
{
"@type": "Organization",
"name": "{{ .Site.Params.name | default .Site.Params.textEmptyValue }}"
}
],
{{ end }}
{{ if $author.sameas }}"sameAs": "{{ $author.sameas }}",{{ end }}
{{ if $author.address }}
"address": {
"@type": "PostalAddress",
"addressLocality": "{{ $author.address.city }}",
"addressRegion": "{{ $author.address.region }}",
"addressCountry": "{{ $author.address.country }}"
},{{ end }}
"image": "{{ $author.thumbnail | absURL }}",
"url": "{{ .Permalink }}"
}
</script>
{{ end }}