Skip to content

Commit de4db3e

Browse files
committed
RSS, better attempt
1 parent ed2dddd commit de4db3e

2 files changed

Lines changed: 10 additions & 22 deletions

File tree

content/episodes/2019/11-27-001.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
date = "2019-11-27"
2+
date = "2019-11-27 19:00:00 +0200"
33
draft = true
44
episode = "001"
55
title = "Test"
@@ -11,18 +11,6 @@ lang = "en"
1111

1212
## Topics
1313

14-
+++
15-
date = "2018-07-16"
16-
draft = false
17-
title = "Episode 125. July"
18-
link = "golangshow.com/cdn/episodes/125-en.mp3"
19-
size = 26005755
20-
length = "00:18:03"
21-
categories = ["english", "news"]
22-
+++
23-
24-
## Topics
25-
2614
- Topic 1
2715
- Topic 2
2816
- Topic 3

layouts/episodes/rss.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@
1818
<itunes:image href="{{ .Site.Params.Image }}" />
1919
<itunes:category text="Technology" />
2020

21-
{{ range .Data.Episodes }}
22-
21+
{{ range .Pages }}
22+
{{ if eq .Lang $.Lang }}
2323
<item>
2424
<title>{{ .Date }}</title>
25-
<itunes:author>{{ .Site.Params.Itunes.Author }}</itunes:author>
25+
<itunes:author>{{ $.Site.Params.Itunes.Author }}</itunes:author>
2626

27-
<itunes:summary><![CDATA[{{ .Content }}]></itunes:summary>
28-
<description><![CDATA[{{ .Content }}]></description>
27+
<itunes:summary>{{ `<![CDATA[` | safeHTML }}{{ .Content }}{{ `]]>` | safeHTML }}</itunes:summary>
28+
<description>{{ `<![CDATA[` | safeHTML }}{{ .Content }}{{ `]]>` | safeHTML }}</description>
2929

30-
<enclosure url="{{ .Link }}" length="{{ .Length}}" type="audio/mpeg" />
31-
<guid>{{ .Link }}</guid>
30+
<enclosure url="{{ .Params.link }}" length="{{ .Params.length}}" type="audio/mpeg" />
31+
<guid>{{ .Params.link }}</guid>
3232
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
3333

34-
<itunes:duration>{{ .Duration }}</itunes:duration>
34+
<itunes:duration>{{ .Params.duration }}</itunes:duration>
3535
<link>{{ .Permalink }}</link>
3636
</item>
37-
37+
{{ end }}
3838
{{ end }}
3939
</channel>
4040
</rss>

0 commit comments

Comments
 (0)