feat: implement RSS feed

This commit is contained in:
recanman 2024-07-03 22:17:09 -07:00
parent 4ad431ffc1
commit a64804c942

View file

@ -0,0 +1,27 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }}</title>
<link>{{ .Site.BaseURL }}</link>
<description>{{ .Site.Params.Description }}</description>
<generator>Hugo</generator>
<language>{{ .Site.LanguageCode }}</language>
<managingEditor>{{ .Site.Params.Author.name }}</managingEditor>
<webMaster>{{ .Site.Params.Author.name }}</webMaster>
<copyright>{{ .Site.Params.Author.name }}</copyright>
<lastBuildDate>{{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</lastBuildDate>
<atom:link href="{{ .Permalink }}" rel="self" type="application/rss+xml" />
{{ range where .Site.Pages "Type" "weekly" }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<guid isPermaLink="true">{{ .Permalink }}</guid>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
<content type="html">{{ .Content | truncate 350 | html }}</content>
<media:thumbnail url="{{ .Permalink }}cover.png" xmlns:media="http://search.yahoo.com/mrss/" />
<media:content medium="image" url="{{ .Permalink }}cover.png" xmlns:media="http://search.yahoo.com/mrss/" />
</item>
{{ end }}
</channel>
</rss>