Skip to content

fix(rss): render photo_gallery and carousel blocks + attach captions#122

Merged
RonanHevenor merged 1 commit intomainfrom
fix/rss-galleries-captions
Apr 24, 2026
Merged

fix(rss): render photo_gallery and carousel blocks + attach captions#122
RonanHevenor merged 1 commit intomainfrom
fix/rss-galleries-captions

Conversation

@RonanHevenor
Copy link
Copy Markdown
Member

Photo galleries and carousels were rendering as "Unknown node" in feed readers, and image captions either dropped or attached to the wrong image. Custom converters on the RSS route render each gallery image as a

with absolute URLs and a paired . Verified: 0 "Unknown node", 145 well-formed figures, xmllint passes.

…o their images

The RSS feed's lexical-to-HTML pass used the default converter from
@payloadcms/richtext-lexical, which doesn't know about our custom
`photo_gallery` and `carousel` blocks and emitted "Unknown node" in
their place. The default upload converter also dropped `fields.caption`,
so block-level and featured-image captions either disappeared or
rendered next to the wrong image.

- Pass a custom `converters` map to convertLexicalToHTML for the RSS
  route: `upload` wraps the image in <figure><img/><figcaption/></figure>
  and pulls the caption from `node.fields.caption`; `blocks.photo_gallery`
  and `blocks.carousel` iterate `fields.images[]` and emit one <figure>
  per image in sequence (vertical stack is the correct degrade in feed
  readers).
- Absolute https://poly.rpi.edu/... URLs on every <img>, HTML-escaped
  captions, existing CDATA escaping untouched.
- Verified against the live /feed endpoint: 0 "Unknown node"
  occurrences (down from many), 145 well-formed <figure> elements with
  paired <figcaption>s, xmllint --noout passes.
@RonanHevenor RonanHevenor merged commit 054221d into main Apr 24, 2026
6 checks passed
@RonanHevenor RonanHevenor deleted the fix/rss-galleries-captions branch April 24, 2026 19:29
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