[[Hugo]] sites come with an RSS feed by default, but if you want to change the feed, such as to make it display the whole content rather than just the summary, follow these steps. ## Create custom RSS template Create a file called `rss.xml` in `themes/<your theme here>/layouts/_default/`. (Replace `<your theme here>` with the name of your theme!) The default RSS template that is included with Hugo can be found [here](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml) on the GoHugo repo, but here's what it looks like as of June 2021: ```rss {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} {{- $pages := slice -}} {{- if or $.IsHome $.IsSection -}} {{- $pages = $pctx.RegularPages -}} {{- else -}} {{- $pages = $pctx.Pages -}} {{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> <link>{{ .Permalink }}</link> <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} {{- with .OutputFormats.Get "RSS" -}} {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} {{- end -}} {{ range $pages }} <item> <title>{{ .Title }}</title> <link>{{ .Permalink }}</link> <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} <guid>{{ .Permalink }}</guid> <description>{{ .Summary | html }}</description> </item> {{ end }} </channel> </rss> ``` ## Make your changes Modify `rss.xml`. This will describe the layout of every item on the feed. Save the file. ## Generate your site Run `hugo server` locally to verify the changes. Check the RSS feed to see your changes in action. By default, this is kept in `/index.xml`; for example: `https://nicolevanderhoeven.com/index.xml` or `localhost:1313/index.xml`. When you're ready, generate the site with `hugo` and you're done! ## References - godo.dev. (2019). _Full-text RSS in Hugo: How to include full blog content in Hugo-generated site's RSS._ Retrieved in June 2021 from [godo.dev](https://www.godo.dev/tutorials/hugo-full-text-rss/)