Skip to content

feat: podcast RSS feed generation (iTunes-compatible)#46

Merged
adurrr merged 3 commits into
mainfrom
feat/issue-10-podcast-rss
Jun 5, 2026
Merged

feat: podcast RSS feed generation (iTunes-compatible)#46
adurrr merged 3 commits into
mainfrom
feat/issue-10-podcast-rss

Conversation

@adurrr

@adurrr adurrr commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Closes #10

Summary

Adds podcast RSS feed generation to Wavecast. The theme now ships a smart RSS template at layouts/_default/rss.xml that auto-detects podcast configuration and renders either a full iTunes-compatible podcast feed or a standard RSS 2.0 feed.

Changes (17 files, +687/-9)

Core RSS feature

  • layouts/_default/rss.xml — smart template: detects [params.podcast] config (author/image/description), renders iTunes podcast RSS with full itunes: namespace, categories, artwork, owner, per-episode enclosure, duration, season/episode, explicit tag. Falls back to plain RSS 2.0 when no podcast config exists.
  • hugo.toml — documented [params.podcast] fields (theme defaults removed to avoid false-positive detection)

Episode front matter

  • All RSS fields live under the podcast: key: src, type, duration, season, episode, explicit, author, guid, episodeType, subtitle, summary
  • Local audio files auto-resolve enclosure length via Hugo resources
  • Only pages with podcast.src appear as feed items

Demo site

  • exampleSite/hugo.toml — full podcast metadata (author, image, categories, owner, explicit, type)
  • exampleSite/content/episodes/rss-demo.md — demo episode with poster, chapters, code blocks, detection table, feed CTA buttons
  • exampleSite/content/_index.md — RSS icon button in hero nav
  • exampleSite/layouts/_default/baseof.html — RSS link in footer, content typography CSS, copy-to-clipboard button styles + JS load

UX improvements

  • assets/js/code-copy.js — copy-to-clipboard button on all code blocks (Clipboard API + fallback)
  • Content typography: h2/h3/p/pre/table spacing rules
  • Episode nav: SVG chevron arrows, actual episode titles in prev/next, dashed back-to-program link, mobile stacking

Tests

  • tests/hugo/rss_test.go — 7 integration tests: iTunes namespace, channel elements, item elements, only-items-with-source filter, standard mode fallback, standard item elements, date sorting
  • tests/hugo/testdata/podcast-rss/ — podcast mode test fixture
  • tests/hugo/testdata/standard-rss/ — standard RSS test fixture

Documentation

  • README.md — full "Podcast RSS Feed" section with config examples, front matter reference, category syntax, validation instructions

Detection logic

Config RSS output
No [params.podcast] Standard RSS 2.0
[params.podcast] with author/image/description iTunes podcast RSS
[params.podcast] but empty values Standard RSS 2.0

Test results

go test (16/16): 7 RSS + 9 shortcode — all pass
vitest (91/91): JS unit tests — all pass

adurrr added 3 commits June 5, 2026 14:31
- Add layouts/_default/rss.xml: auto-detects podcast config and renders
  either iTunes podcast RSS (with itunes: namespace, categories, owner,
  artwork, per-episode enclosure/tags) or a standard RSS 2.0 feed.
- Detection: checks for author, image, or description in [params.podcast];
  no toggle flag needed.
- Episode front matter: all RSS fields under podcast: key (src, type,
  duration, season, episode, explicit, author, guid, episodeType).
- Local audio auto-resolves enclosure length via Hugo resources.
- Add exampleSite podcast config and rss-demo episode with full metadata.
- Add copy-to-clipboard buttons on code blocks (assets/js/code-copy.js).
- Improve content typography: h2/h3/p/pre/table spacing in baseof.css.
- Improve episode nav: SVG chevron arrows, actual episode titles,
  dashed back-to-program link, mobile stacking layout.
- Fix program URL fallback for episodes without a program page.
- Add 7 Hugo integration tests for RSS (podcast + standard modes).
- Document podcast RSS in README with config examples and front matter
  reference.
The RSS test fixtures used go.mod files with replace directives to
import the wavecast module. This failed on CI because Hugo module
resolution in subdirectories differs from local dev.

Fix: follow the existing testdata pattern - copy the RSS template
locally into each test fixture's layouts/_default/rss.xml and remove
the [module] imports and go.mod files. The test sites are now fully
self-contained, matching how the shortcode tests work.

Also removed --quiet from buildHugoSite to ensure Hugo error output
is visible in CI logs when builds fail.
…0.146+

.Site.Language.Locale was added in Hugo v0.148.0. The CI workflow
uses Hugo v0.146.0, so the RSS template crashed with:
  can't evaluate field Locale in type *langs.Language

Replaced with .Site.LanguageCode which is available since Hugo 0.80+.
@adurrr adurrr merged commit 8538be4 into main Jun 5, 2026
4 checks passed
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.

Add RSS feed support to Wavecast

1 participant