diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2024-09-29 15:54:01 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <git@serghei.pl> | 2024-09-29 18:15:42 +0200 |
| commit | 0882a21997b0830f43643cac9f0de4beaa698988 (patch) | |
| tree | 581a1dea498805ef5b9259fbf095b5546d705a78 /layouts/partials/schema.org | |
| parent | ec19cd59b5fc2ee4dc12b65647099c595984c075 (diff) | |
| download | gohugo-theme-ed-0882a21997b0830f43643cac9f0de4beaa698988.tar.gz | |
Rework author configuration
Diffstat (limited to 'layouts/partials/schema.org')
| -rw-r--r-- | layouts/partials/schema.org/article.html | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/layouts/partials/schema.org/article.html b/layouts/partials/schema.org/article.html index f4112b6..1549784 100644 --- a/layouts/partials/schema.org/article.html +++ b/layouts/partials/schema.org/article.html @@ -13,7 +13,20 @@ {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") -}} {{- $logo = $logo.Resize "96x96" }} -{{- $siteAuthor := partial "site-author.html" . }} +{{- $siteAuthorName := "" }} +{{- $siteAuthorTwitter := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $siteAuthorName = . }} + {{- end -}} + {{- with .twitter }} + {{- $siteAuthorTwitter = . }} + {{- end }} + {{- else }} + {{- $siteAuthorName = . }} + {{- end }} +{{- end }} <script type="application/ld+json" id="schema-data"> { @@ -53,10 +66,10 @@ ], {{- end }} {{- else }} - {{- with $siteAuthor.name }} + {{- with $siteAuthorName }} "author": { "@type": "Person", - "name": {{ . }}{{ with $siteAuthor.twitter }}, + "name": {{ . }}{{ with $siteAuthorTwitter }}, "url": "https://twitter.com/{{ . }}"{{ end }} }, {{- end }} |
