Emit full post content in RSS feeds#110
Merged
Merged
Conversation
Hugo's embedded RSS template emits only <description> with .Summary, truncating feed items to the first paragraph. This overrides the embedded template to also emit a <content:encoded> element per item with the full rendered HTML body of the newsletter or topic page. - Adds xmlns:content namespace to <rss> root - Keeps <description> unchanged for readers that only render it - Uses transform.XMLEscape (same pattern as embedded template) - Applies to all 10 language feeds (single template, no per-language work) Verified well-formed XML on Hugo v0.123.7 and v0.140.0 (CI version).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hugo's embedded RSS template emits only
<description>with.Summary, truncating feed items to the first paragraph. This overrides the embedded template to also emit a<content:encoded>element per item with the full rendered HTML body of the newsletter or topic page.Change
Single new file:
layouts/_default/rss.xml(68 lines).xmlns:content="http://purl.org/rss/1.0/modules/content/"to the<rss>root.<content:encoded>{{ .Content | transform.XMLEscape | safeHTML }}</content:encoded>on each<item>.<description>unchanged for readers that only render that field.Verification
Tested against both Hugo v0.123.7 (local) and Hugo v0.140.0 (CI version).
en,de,es,fr,it,ja,ko,nl,pt,zh).<content:encoded>count in every feed (138 EN, 121 per translation).<content:encoded>is ~80KB — from opening welcome line through closing content, all H2 sections intact.Why not an alternative
<!--more-->divider would require touching every newsletter and topic across all 10 languages, and would break on-site newsletter list cards.summaryLengthbump would change every.Summarycall site-wide.Custom template override is the mechanism Hugo itself documents for this.