From 5f0abfda179c86f39effbc36b291a53632c4caa8 Mon Sep 17 00:00:00 2001 From: Ristik Majumdar <34515568+1bl4z3r@users.noreply.github.com> Date: Sun, 3 Nov 2024 17:23:07 +0530 Subject: [PATCH] Add fallback to Author url for #98 --- layouts/partials/webschema.html | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/layouts/partials/webschema.html b/layouts/partials/webschema.html index 8b0f773..faf8fd9 100644 --- a/layouts/partials/webschema.html +++ b/layouts/partials/webschema.html @@ -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 }}