Skip to content

Add itemTitle parameter to atomFeed for per-entry title policy#53

Draft
deverman wants to merge 1 commit into
loopwerk:mainfrom
deverman:feed-writers
Draft

Add itemTitle parameter to atomFeed for per-entry title policy#53
deverman wants to merge 1 commit into
loopwerk:mainfrom
deverman:feed-writers

Conversation

@deverman

@deverman deverman commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

atomFeed already accepts summary:, image:, and dateKeyPath: closures, but entry titles are always item.title — the raw parsed title. That blocks two real cases: readers that keep Markdown emphasis markers in extracted titles (# A _great_ title ships with literal underscores), and sites whose feed titles follow an SEO-title policy from front matter rather than the visible H1.

This adds an optional itemTitle: (Item<M>) -> String closure in the same style as the existing parameters. When omitted, behavior is unchanged, so existing call sites are unaffected. Also adds the first test coverage for atomFeed (default and override) and updates the symbol reference in the Custom Feed Formats guide.

Context: deverman.org currently maintains a near-copy of atomFeed solely to apply its title policy; with this parameter that copy gets deleted.

Entry titles were always item.title, which carries the raw parsed title
(including Markdown emphasis markers from readers that keep them) and
prevents sites from applying an SEO-title policy to feed entries.

itemTitle is an optional closure in the same style as the existing
summary: and image: parameters, defaulting to the item's title so
existing call sites are unaffected. Adds the first atomFeed test,
covering both the default and the override.
@kevinrenskers

Copy link
Copy Markdown
Member

This looks great! Is there a reason it's marked as draft?

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.

2 participants