Skip to content

Emit full post content in RSS feeds#110

Merged
Datawav merged 1 commit into
mainfrom
fix/rss-full-content
Jul 10, 2026
Merged

Emit full post content in RSS feeds#110
Datawav merged 1 commit into
mainfrom
fix/rss-full-content

Conversation

@Datawav

@Datawav Datawav commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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).

  • Copies Hugo's embedded RSS template.
  • Adds xmlns:content="http://purl.org/rss/1.0/modules/content/" to the <rss> root.
  • Emits <content:encoded>{{ .Content | transform.XMLEscape | safeHTML }}</content:encoded> on each <item>.
  • Keeps existing <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).

  • All 10 language feeds well-formed per Python XML parser (en, de, es, fr, it, ja, ko, nl, pt, zh).
  • Item count matches <content:encoded> count in every feed (138 EN, 121 per translation).
  • Newsletter Update logo to PNG and refine layout #30's <content:encoded> is ~80KB — from opening welcome line through closing content, all H2 sections intact.
  • Feed size grows from ~35KB to ~1.5-2.2MB per language (expected for full-content feeds).

Why not an alternative

  • No Hugo config flag exists to make the embedded template emit full content.
  • <!--more--> divider would require touching every newsletter and topic across all 10 languages, and would break on-site newsletter list cards.
  • summaryLength bump would change every .Summary call site-wide.

Custom template override is the mechanism Hugo itself documents for this.

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).
@Datawav
Datawav merged commit 04e87b9 into main Jul 10, 2026
2 checks passed
@Datawav
Datawav deleted the fix/rss-full-content branch July 10, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant