Fix voor menu en eerste versie Schema.org

This commit is contained in:
Michael Boelen 2023-05-17 09:30:00 +02:00
parent 61b8a510b7
commit 75e0ce9ddf
9 changed files with 444 additions and 267 deletions

View file

@ -0,0 +1,64 @@
{{ if isset .Params "author" }}
{{ $author := index .Site.Data.team .Params.author }}
{{ $location := index .Site.Data.location .Site.Params.primarylocation }}
<script type="application/ld+json">
{
"@context": "http://www.schema.org",
"@type": "Person",
"@id": "{{ .Permalink }}",
"name": "{{ $author.name }}",
"alternateName": "{{ $author.name }}",
{{ if $author.nationality }}"nationality": "{{ $author.nationality }}",{{ end }}
{{ if $author.address }}
"birthPlace" : {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"addressLocality": "{{ $author.address.city }}",
"addressRegion": "{{ $author.address.region }}",
"addressCountry": "{{ $author.address.country }}"
}
},{{ end }}
"affiliation": [
{
"@type": "Organization",
"name": "{{ .Site.Params.name }}",
"sameAs": [ {{ partial "schemas/schema_Social.html" .Site.Params }}
]
}
],
{{ if $author.education }}
"alumniOf": [
{
"@type": "CollegeOrUniversity",
"name": "{{ $author.education.university }}",
"sameAs": "{{ $author.education.url }}"
}
],
{{ end }}
{{ 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 }}
"worksFor": [
{
"@type": "Organization",
"name": "{{ .Site.Params.name }}",
"sameAs": [ {{ partial "schemas/schema_Social.html" .Site.Params }}
]
}
],
"url": "{{ .Site.BaseURL }}",
"image": "{{ $author.thumbnail | absURL }}",
{{ if $author.address }}
"address": {
"@type": "PostalAddress",
"addressLocality": "{{ $author.address.city }}",
"addressRegion": "{{ $author.address.region }}",
"addressCountry": "{{ $author.address.country }}"
},{{ end }}
"sameAs": [ {{ partial "schemas/schema_Social.html" $author }}
]
}
</script>
{{ end }}

View file

@ -0,0 +1,22 @@
{{ if .social }}
{{ if .social.twitter }}"https://twitter.com/{{ .social.twitter }}",{{ end }}
{{ if .social.pinterest }}"https://pinterest.com/{{ .social.pinterest }}",{{ end }}
{{ if .social.instagram }}"https://instagram.com/{{ .social.instagram }}",{{ end }}
{{ if .social.facebook }}"https://www.facebook.com/{{ .social.facebook }}",{{ end }}
{{ if .social.linkedin }}"https://ca.linkedin.com/in/{{ .social.linkedin }}/en",{{ end }}
{{ if .social.googleplus }}"https://plus.google.com/+{{ .social.googleplus }}",{{ end }}
{{ if .social.youtube }}"https://www.youtube.com/user/{{ .social.youtube }}",{{ end }}
{{ if .social.github }}"https://github.com/{{ .social.github }}",{{ end }}
{{ if .social.wordpress }}"https://profiles.wordpress.org/{{ .social.wordpress }}",{{ end }}
{{ if .social.angel }}"https://angel.co/{{ .social.angel }}",{{ end }}
{{ if .social.foursquare }}"https://www.foursquare.com/user/{{ .social.foursquare }}",{{ end }}
{{ if .social.yelp }}"https://{{ .social.yelp }}.yelp.ca",{{ end }}
{{ if .social.codepen }}"https://codepen.io/{{ .social.codepen }}/",{{ end }}
{{ if .social.stackoverflow }}"https://stackoverflow.com/users/{{ .social.stackoverflow }}",{{ end }}
{{ if .social.dribbble }}"https://dribbble.com/{{ .social.dribbble }}",{{ end }}
{{ if .social.deviantart }}"http://{{ .social.deviantart }}.deviantart.com/",{{ end }}
{{ if .social.behance }}"https://www.behance.net/{{ .social.behance }}",{{ end }}
{{ if .social.flickr }}"https://www.flickr.com/people/{{ .social.flickr }}/",{{ end }}
{{ if .social.medium }}"https://medium.com/@{{ .social.medium }}",{{ end }}
{{ if .social.website }}"{{ .social.website }}"{{ else }}"{{ .Site.Params.social.website }}"{{ end }}
{{ end }}

View file

@ -0,0 +1,118 @@
{{ $baseUrl := .Site.BaseURL }}
{{ $location := index .Site.Data.location .Site.Params.primarylocation }}
<script type="application/ld+json">
[
{
"@context": "https://schema.org",
"@type": "Webpage",
"specialty": "{{ .Site.Params.description | default .Site.Params.textNoTitle }}",
"mainContentOfPage": {
"@context": "https://schema.org/",
"@type": "WebPageElement",
"cssSelector": ".body-contentTODO"
},
"primaryImageOfPage": "{{ .Site.Params.imageurl | absURL }}"
},
{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "{{ .Site.BaseURL }}",
"additionalType": ["CreativeWork", "Person"],
"url": "{{ .Site.BaseURL }}",
"name": "{{ .Site.Title | default .Site.Params.textNoTitle }}",
"alternateName": "{{ .Site.Title | default .Site.Params.textNoTitle }}",
"headline": "{{ .Site.Params.description | default .Site.Params.textNoTitle }}",
"image": "{{ .Site.Params.imageurl | absURL | default .Site.Params.textNoTitle }}",
"inLanguage": "{{ .Site.LanguageCode }}",
"author": "{{ .Site.Params.author | default .Site.Params.textNoTitle }}",
"description": "{{ .Site.Params.description }}",
"disambiguatingDescription": "{{ .Site.Params.description | default .Site.Params.textNoTitle }}",
"isFamilyFriendly": "True",
"sourceOrganization": "{{ .Site.Title | default .Site.Params.textNoTitle }}",
"publisher": {
"@type": "Organization",
"name": "{{ .Site.Title | default .Site.Params.textNoTitle }}",
"logo": {
"@type": "ImageObject",
"url": "{{ .Site.Params.logourl | absURL | default .Site.Params.textNoTitle }}",
"height": 60,
"width": 107
}
},
"mainEntity": {
"@context": "https://schema.org",
"@type": "localBusiness",
"name": "{{ .Site.Title }}",
"image":"{{ $location.thumbnail | absURL }}",
"priceRange":"{{ .Site.Params.pricerange }}",
"telephone":"{{ .Site.Params.phone }}",
"address": {
"@type": "PostalAddress",
"streetAddress": "{{ $location.address.street }}",
"addressLocality": "{{ $location.address.city }}",
"addressRegion": "{{ $location.address.region }}",
"addressCountry": "{{ $location.address.country }}",
"postalCode": "{{ $location.address.postalcode | default .Site.Params.textNoTitle }}"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"reviewCount": "50"
}
},
"potentialAction": {
"@type": "SearchAction",
"target": "{{ .Site.BaseURL }}?search={search_term}",
"query-input": "required name=search_term"
},
"keywords":[
{{ range $i, $e := .Site.Params.keywords }}{{ if $i }}, {{ end }}"{{ $e }}"{{ end }}
],
"hasPart": [
{
"@context": "http://schema.org/",
"@type": "WPHeader",
"@id": "#header",
"headline": "{{ .Site.Params.description }}",
"cssSelector": "#header",
"potentialAction": [{{ range $i, $e := .Site.Menus.actions }}{{ if $i }}, {{ end }}
{
"@type": "Action",
"name": "{{ $e.Title }}",
"target": "{{ $e.URL | absURL }}"
}
{{- end -}}
],
"@graph":
[{{ range $i, $e := .Site.Menus.main }}{{ if $i }}, {{ end }}
{
"@context": "https://schema.org",
"@type":"SiteNavigationElement",
"@id":"#header",
"name": "{{ $e.Title }}",
"url": "{{ $e.URL | absURL }}"
}
{{- end -}}
]
},
{
"@context": "http://schema.org/",
"@type": "WPSidebar",
"cssSelector": "#sidebar",
"citation": [
{{ range $i, $e := .Site.Menus.main }}{{ if $i }}, {{ end }}"{{ $e.URL | absURL }}"{{ end }}
]
},
{
"@context": "http://schema.org/",
"@type": "WPFooter",
"cssSelector": ".footer",
"@id": "#footer",
"copyrightHolder":"{{ .Site.Title }}",
"publisher": "{{ .Site.Title }}",
"copyrightYear":"{{ now.Format "2006"}}"
}
]
}
]
</script>