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/_default/list.jsonfeed.json | |
| parent | ec19cd59b5fc2ee4dc12b65647099c595984c075 (diff) | |
| download | gohugo-theme-ed-0882a21997b0830f43643cac9f0de4beaa698988.tar.gz | |
Rework author configuration
Diffstat (limited to 'layouts/_default/list.jsonfeed.json')
| -rw-r--r-- | layouts/_default/list.jsonfeed.json | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/layouts/_default/list.jsonfeed.json b/layouts/_default/list.jsonfeed.json index 29c9bf4..d44c7e0 100644 --- a/layouts/_default/list.jsonfeed.json +++ b/layouts/_default/list.jsonfeed.json @@ -14,7 +14,20 @@ {{- $limit := site.Params.feedSize | default 25 -}} {{- $pages = $pages | first $limit -}} -{{- $siteAuthor := partial "site-author.html" . -}} +{{- $authorName := "" }} +{{- $authorTwitter := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end -}} + {{- with .twitter }} + {{- $authorTwitter = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- end }} { "version": "https://jsonfeed.org/version/1.1", @@ -25,9 +38,9 @@ {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") }}{{ $logo = $logo.Resize "96x96" }} "icon": {{ $logo.Permalink | jsonify }}, "favicon": {{ $logo.Permalink | jsonify }}, - {{ with $siteAuthor.name }}"authors": [ + {{ with $authorName }}"authors": [ { - "name": {{ . | jsonify }}{{ with $siteAuthor.twitter }}, + "name": {{ . | jsonify }}{{ with $authorTwitter }}, "url": {{ (printf "https://twitter.com/%s" . ) | jsonify }}{{ end }} } ],{{ end }} |
