Added correct time format for podcast.

This commit is contained in:
Asaf Gartner 2021-09-06 22:48:39 +03:00
parent ff8fbcd632
commit 193bbca28c
2 changed files with 4 additions and 1 deletions

View File

@ -23,7 +23,7 @@
<itunes:episode>{{ .EpisodeNumber }}</itunes:episode> <itunes:episode>{{ .EpisodeNumber }}</itunes:episode>
<itunes:order>{{ .EpisodeNumber }}</itunes:order> <itunes:order>{{ .EpisodeNumber }}</itunes:order>
<enclosure url="{{ .FileUrl }}" length="{{ .FileSize }}" type="audio/mpeg" /> <enclosure url="{{ .FileUrl }}" length="{{ .FileSize }}" type="audio/mpeg" />
<pubDate>{{ .PublicationDate }}</pubDate> <pubDate>{{ rfc1123 .PublicationDate }}</pubDate>
<itunes:duration>{{ .Duration }}</itunes:duration> <itunes:duration>{{ .Duration }}</itunes:duration>
<link>{{ .Url }}</link> <link>{{ .Url }}</link>
</item> </item>

View File

@ -117,6 +117,9 @@ var HMNTemplateFuncs = template.FuncMap{
"rfc3339": func(t time.Time) string { "rfc3339": func(t time.Time) string {
return t.UTC().Format(time.RFC3339) return t.UTC().Format(time.RFC3339)
}, },
"rfc1123": func(t time.Time) string {
return t.UTC().Format(time.RFC1123)
},
"alpha": func(alpha float64, color noire.Color) noire.Color { "alpha": func(alpha float64, color noire.Color) noire.Color {
color.Alpha = alpha color.Alpha = alpha
return color return color