Skip to content

Commit

Permalink
Add fallback to Author url for #98
Browse files Browse the repository at this point in the history
  • Loading branch information
1bl4z3r committed Nov 3, 2024
1 parent ca018c3 commit 5f0abfd
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions layouts/partials/webschema.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,15 @@
{{ end -}}
"datePublished": {{ .PublishDate }},
"dateModified": {{ .Lastmod }},
{{- if .Params.author }}
"author":{
"@type": "Person",
"name": {{ .Params.author }},
"url": {{ (ref . .Params.authorLink) | default (ref . .Site.Params.author.about) }}
},
{{ else }}
"author":{
"@type": "Person",
"name": {{ site.Params.author.name }},
"name": {{ .Params.author | default .Site.Params.author.name }},
{{- if .Params.authorLink }}
"url": {{ ref . .Params.authorLink }}
{{ else if .Site.Params.author.about }}
"url": {{ ref . .Site.Params.author.about }}
{{ end -}}
},
{{ end -}}
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{ .Permalink | safeHTML }}
Expand Down

0 comments on commit 5f0abfd

Please sign in to comment.