In Hugo, the RSS internal template produces feed with entire article content. Should it?

I’m wondering whether the internal RSS template should cap the rss.channel.item.description should contain the entire article or not. By default it does. I just noticed that when I looked my website’s generated RSS feed of articles.

I’m unfamiliar w/ the RSS standard, but it seems like too much text and also makes the RSS feed size ridiculously large. I think it should just contain a summary, otherwise, sites with hundreds of long articles could very well produce a really large feed, taking up bandwidth and resources…

Does this even matter? I am sure that it’s not the first time anyone has ideated this?

@Hash_Borgir This has definitely come up before. See this PR and the associated conversations and comments:

https://github.com/spf13/hugo/pull/3219

You cal make a own rss template in layouts/_default/rss.xml

Here my version - truncating .Content and build the guid by md5.
This is now pure RSS.

<rss version="2.0" >
  <channel>
    <title>{{ with .Title }}{{.}} auf {{ end }}{{ .Site.Title }}</title>
    <link>{{"feed.xml" | urlize}}</link>
    <description>{{.Title}} auf {{ .Site.Title }}</description>
    <generator>Hugo -- gohugo.io</generator>
    {{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}}
    {{ with .Site.Author.name }}<managingEditor>{{.}}{{ with $.Site.Author.email }} ({{.}}){{end}}</managingEditor>{{end}}
    {{ with .Site.Author.name }}<webMaster>{{.}}{{ with $.Site.Author.email }} ({{.}}){{end}}</webMaster>{{end}}
    {{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}}
    {{ if not .Lastmod.IsZero }}<lastBuildDate>{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 CET" | safeHTML }}</lastBuildDate>{{ end }}
    
    {{ range first 25 .Data.Pages }}
    <item>
      <title>{{ .Title }}</title>
      <link>{{ .Permalink }}</link>
      <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 CET" | safeHTML }}</pubDate>
      {{ with .Site.Author.name }}<author>{{.}}{{ with $.Site.Author.email }} ({{.}}){{end}}</author>{{end}}
      <guid>{{ md5 .Content }}</guid>
      <description>{{ .Content | truncate 240 | html }}</description>
    </item>
    {{ end }}
  </channel>
</rss>
1 Like

Hi

.Date.Format "Mon, 02 Jan 2006 15:04:05 CET"

doesn’t seem W3C valid.

checked it

<pubDate>{{ $date.Format site.Params.dateFormatRFC822Z | safeHTML }}</pubDate>

with

dateFormatRFC822Z = "02 Jan 2006 15:04:05 UT"

is validated