aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2021-10-26-rss-feed-no-longer-annoyingly-trunca.md
blob: 9f9696d6c023973a9ee72ece46a9af78ad36fe5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
slug: rss-feed-no-longer-annoyingly-trunca
title: "RSS Feed No Longer Annoyingly Trunca..."
date: "2021-10-26T23:53:22-04:00"
---

[Hugo's default RSS feed template][default] truncates [RSS][] feeds by
default.  Long time readers [probably know how I feel about that][argh].

I copied the [default Hugo RSS feed template][default] and made the
following changes:

* Limited the feed to pages in the "Posts" section (**Note:** this may
  not work for your site).
* Set the default post limit to 15 posts, because [Hugo][] was trying to
  include all posts in the [RSS][] feed.
* Changed feed items to include complete post contents as [HTML][].

The updated template is available in [this gist][gist].  You can use it
on your site by copying it to `layouts/_default/index.xml`.

[default]: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml
  "Default Hugo RSS feed template"
[rss]: https://en.wikipedia.org/wiki/RSS
  "Really Simple Syndication"
[argh]: {{< ref "posts/2009-06-25-don-t-truncate-your-rss-feed.html" >}}
  "Don't Truncate Your RSS Feed"
[hugo]: https://gohugo.io/
  "Hugo static site generator"
[html]: https://en.wikipedia.org/wiki/HTML
  "HyperText Markup Language"
[gist]: https://gist.github.com/b7e12f07a204fa10ccbfaf401e6b67ff
  "Updated Hugo RSS feed template"