summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.atom.xml6
-rw-r--r--layouts/_default/list.feed.xml6
-rw-r--r--layouts/_default/list.json.json4
-rw-r--r--layouts/_default/sitemap.xml4
-rw-r--r--layouts/partials/post-meta/date.html4
5 files changed, 11 insertions, 13 deletions
diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml
index 75892fd..5da5f25 100644
--- a/layouts/_default/list.atom.xml
+++ b/layouts/_default/list.atom.xml
@@ -33,7 +33,7 @@
</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 not site.LastChange.IsZero }}
- <updated>{{ site.LastChange.UTC.Format site.Params.dateFormatFeed }}</updated>{{ end }}{{ $uuid := sha1 (site.BaseURL | absURL) }}
+ <updated>{{ site.LastChange.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}</updated>{{ end }}{{ $uuid := sha1 (site.BaseURL | absURL) }}
<id>urn:uuid:{{ substr $uuid 0 8 }}-{{ substr $uuid 8 4 }}-5{{ substr $uuid 13 3 }}-{{ substr $uuid 16 1 }}9{{ substr $uuid 17 2 }}-{{ substr $uuid 21 12 }}</id>{{- range $pages }}
<entry>
{{- $url := .Permalink | absURL }}{{ $uuid := sha1 (.Permalink | absURL) }}{{ $page := . }}
@@ -42,8 +42,8 @@
<link rel="alternate" type="type/html" href="{{ $url }}?utm_source=atom_feed" />
{{ printf `<title type="html"><![CDATA[%s]]></title>` .Title | safeHTML }}{{ range first 5 (site.RegularPages.Related .) }}
<link href="{{ .Permalink }}?utm_source=atom_feed" rel="related" type="text/html" title="{{ .Title }}" />{{ end }}
- <published>{{ (.PublishDate.Format site.Params.dateFormatFeed) | html }}</published>{{ if ne .Date .Lastmod }}
- <updated>{{ .Lastmod.UTC.Format site.Params.dateFormatFeed }}</updated>{{ end }}
+ <published>{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}</published>{{ if ne .Date .Lastmod }}
+ <updated>{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}</updated>{{ end }}
<id>urn:uuid:{{ substr $uuid 0 8 }}-{{ substr $uuid 8 4 }}-5{{ substr $uuid 13 3 }}-{{ substr $uuid 16 1 }}9{{ substr $uuid 17 2 }}-{{ substr $uuid 21 12 }}</id>
{{ if .Params.author }}
{{- $author_type := (printf "%T" .Params.author) }}
diff --git a/layouts/_default/list.feed.xml b/layouts/_default/list.feed.xml
index ae16aca..d66688b 100644
--- a/layouts/_default/list.feed.xml
+++ b/layouts/_default/list.feed.xml
@@ -14,7 +14,7 @@
{{- $limit := site.Params.feedSize | default 25 -}}
{{- $pages = $pages | first $limit -}}
-{{- safeHTML "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" }}
+{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
@@ -49,11 +49,11 @@
{{ 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 not site.LastChange.IsZero }}
- <lastBuildDate>{{ site.LastChange.UTC.Format site.Params.dateFormatRFC822Z | html }}</lastBuildDate>{{ end }}{{- range $pages }}
+ <lastBuildDate>{{ site.LastChange.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}{{- range $pages }}
<item>
{{ printf `<title type="html"><![CDATA[%s]]></title>` .Title | safeHTML }}
<link>{{ .Permalink | absURL }}?utm_source=rss_feed</link>
- <pubDate>{{ .PublishDate.UTC.Format site.Params.dateFormatRFC822Z | html }}</pubDate>
+ <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<category>{{ .Section }}</category>{{ range (.GetTerms "tags") }}
<category>{{ .LinkTitle }}</category>{{end}}
<guid isPermaLink="false">{{ md5 .Permalink }}</guid>
diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json
index b912df0..70ea7a4 100644
--- a/layouts/_default/list.json.json
+++ b/layouts/_default/list.json.json
@@ -36,8 +36,8 @@
"url": {{ printf "%s?utm_source=json_feed" .Permalink | jsonify }},
"title": {{ .Title | plainify | chomp | jsonify }},
"summary": {{ .Summary | plainify | chomp | jsonify }},
- "date_published": {{ .PublishDate.UTC.Format site.Params.dateFormatFeed | jsonify }}{{ if ne .Date .Lastmod }},
- "date_modified" : {{ .Lastmod.UTC.Format site.Params.dateFormatFeed | jsonify }}{{ end }}
+ "date_published": {{ .PublishDate.Format "2006-01-02T15:04:05Z07:00" | jsonify }}{{ if ne .Date .Lastmod }},
+ "date_modified" : {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | jsonify }}{{ end }}
}
{{- end}}
]
diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml
index 3745dc5..939dcac 100644
--- a/layouts/_default/sitemap.xml
+++ b/layouts/_default/sitemap.xml
@@ -1,12 +1,10 @@
-{{- $dateFormat := site.Params.dateFormatFeed | default "2006-01-02T15:04:05-07:00" -}}
-
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Data.Pages }}{{ if ne .Params.private true }}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
- <lastmod>{{ safeHTML ( .Lastmod.Format $dateFormat | html ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
+ <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05Z07:00" | jsonify ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link
diff --git a/layouts/partials/post-meta/date.html b/layouts/partials/post-meta/date.html
index e5626cf..42747f2 100644
--- a/layouts/partials/post-meta/date.html
+++ b/layouts/partials/post-meta/date.html
@@ -1,5 +1,5 @@
-{{ $date := .Date | time.Format (site.Params.dateformat | default "January 02, 2006") }}
-{{ $lastmod := .Lastmod | time.Format (site.Params.dateformat | default "January 02, 2006") }}
+{{ $date := .Date | time.Format (site.Params.dateFormat | default "January 02, 2006") }}
+{{ $lastmod := .Lastmod | time.Format (site.Params.dateFormat | default "January 02, 2006") }}
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{ $date }}