summaryrefslogtreecommitdiffstats
path: root/layouts/_default
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2024-04-14 15:30:44 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2024-04-14 15:38:50 +0200
commit23d77288040ca113dbc797aa2eaff6ba2a32f324 (patch)
treec14a8417684dd54ea7425f7bc64d52d315973ad4 /layouts/_default
parent77b73fceb49bff397dab6badb7df8e821960fe2b (diff)
downloadgohugo-theme-ed-23d77288040ca113dbc797aa2eaff6ba2a32f324.tar.gz
Move site author configuration to params
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/home.humanstxt.txt12
-rw-r--r--layouts/_default/list.atom.xml5
-rw-r--r--layouts/_default/list.feed.xml3
-rw-r--r--layouts/_default/list.jsonfeed.json6
4 files changed, 16 insertions, 10 deletions
diff --git a/layouts/_default/home.humanstxt.txt b/layouts/_default/home.humanstxt.txt
index 0d3efe9..23286fe 100644
--- a/layouts/_default/home.humanstxt.txt
+++ b/layouts/_default/home.humanstxt.txt
@@ -1,11 +1,12 @@
-{{- with site.Author.name }}
+{{- $siteAuthor := partial "site-author.html" . -}}
+{{- with $siteAuthor.name }}
/* TEAM */
Author: {{ . }}
-{{- with site.Author.email }}{{ printf "\n Contact: %s" . }}{{ end }}
-{{- with site.Author.github }}{{ printf "\n GitHub: @%s" . }}{{ end }}
-{{- with site.Author.twitter }}{{ printf "\n Twitter: @%s" . }}{{ end }}
-{{- with site.Author.location }}{{ printf "\n From: %s" . }}{{ end }}
+{{- with $siteAuthor.email }}{{ printf "\n Contact: %s" . }}{{ end }}
+{{- with $siteAuthor.github }}{{ printf "\n GitHub: @%s" . }}{{ end }}
+{{- with $siteAuthor.twitter }}{{ printf "\n Twitter: @%s" . }}{{ end }}
+{{- with $siteAuthor.location }}{{ printf "\n From: %s" . }}{{ end }}
{{- end }}
/* SITE */
@@ -15,3 +16,4 @@
Doctype: HTML5
Standards: HTML5, CSS3, Open Graph protocol, Schema.org
Components: Hugo, Ed Theme, Lunr.js
+ Hugo version: {{ site.Hugo.Version }}
diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml
index 67ff79b..edc133b 100644
--- a/layouts/_default/list.atom.xml
+++ b/layouts/_default/list.atom.xml
@@ -15,6 +15,7 @@
{{- $pages = $pages | first $limit -}}
{{- $siteLastMod := partial "site-last-mod.html" . -}}
+{{- $siteAuthor := partial "site-author.html" . -}}
{{- safeHTML "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" }}
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="{{ site.LanguageCode }}" xml:base="{{ site.BaseURL }}">
@@ -28,10 +29,10 @@
{{- end -}}
{{- end }}
{{ $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png") }}{{ $logo = $logo.Resize "96x96" }}<icon>{{ $logo.Permalink | absURL }}</icon>
- <logo>{{ $logo.Permalink | absURL }}</logo>{{ with site.Author.name }}
+ <logo>{{ $logo.Permalink | absURL }}</logo>{{ with $siteAuthor.name }}
<author>
{{ printf `<name type="html"><![CDATA[%s]]></name>` . | safeHTML }}
- {{ with site.Author.email }}<email>{{ . | html }}</email>{{ end }}
+ {{ with $siteAuthor.email }}<email>{{ . | html }}</email>{{ end }}
</author>{{ end }}{{ with site.Params.Copyright }}{{ $copyright := replace . "{year}" now.Year }}{{ $copyright = replace $copyright "&copy;" "©" }}
<rights>{{ $copyright | plainify }}</rights>{{ end }}
<generator uri="https://gohugo.io" version="{{ hugo.Version }}">Hugo</generator>{{ if ne $siteLastMod "" }}
diff --git a/layouts/_default/list.feed.xml b/layouts/_default/list.feed.xml
index 2bc3cb7..ae4366b 100644
--- a/layouts/_default/list.feed.xml
+++ b/layouts/_default/list.feed.xml
@@ -15,6 +15,7 @@
{{- $pages = $pages | first $limit -}}
{{- $siteLastMod := partial "site-last-mod.html" . -}}
+{{- $siteAuthor := partial "site-author.html" . -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0"
@@ -47,7 +48,7 @@
{{- end -}}
{{- end }}
{{ with site.Params.description }}{{ printf `<description type="html"><![CDATA[%s]]></description>` . | safeHTML }}{{ end }}
- <generator>Hugo {{ hugo.Version }}</generator>{{ with site.Author.name }}
+ <generator>Hugo {{ hugo.Version }}</generator>{{ with $siteAuthor.name }}
{{ printf `<dc:creator type="html"><![CDATA[%s]]></dc:creator>` . | safeHTML }}{{ end }}{{ with site.LanguageCode }}
<language>{{ . }}</language>{{ end }}{{ with site.Params.Copyright }}{{ $copyright := replace . "{year}" now.Year }}{{ $copyright = replace $copyright "&copy;" "©" }}
<copyright>{{ $copyright | plainify }}</copyright>{{ end }}{{ if ne $siteLastMod "" }}
diff --git a/layouts/_default/list.jsonfeed.json b/layouts/_default/list.jsonfeed.json
index f6b89cc..29c9bf4 100644
--- a/layouts/_default/list.jsonfeed.json
+++ b/layouts/_default/list.jsonfeed.json
@@ -14,6 +14,8 @@
{{- $limit := site.Params.feedSize | default 25 -}}
{{- $pages = $pages | first $limit -}}
+{{- $siteAuthor := partial "site-author.html" . -}}
+
{
"version": "https://jsonfeed.org/version/1.1",
"title": {{ (partial "title.html" .) | htmlUnescape | jsonify }},
@@ -23,9 +25,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 site.Author.name }}"authors": [
+ {{ with $siteAuthor.name }}"authors": [
{
- "name": {{ . | jsonify }}{{ with site.Author.twitter }},
+ "name": {{ . | jsonify }}{{ with $siteAuthor.twitter }},
"url": {{ (printf "https://twitter.com/%s" . ) | jsonify }}{{ end }}
}
],{{ end }}