Skip to content

Conversation

seanyeh
Copy link
Contributor

@seanyeh seanyeh commented Oct 4, 2025

Proposed changes

Add meta images to blog rss feed. I initially wanted to use media:content but somehow my rss feed reader didn't really like it so I think adding the image to the top of the description is simpler
Without adding the meta images, my feed reader was showing a random image from the article as the main image, which isn't as nice

Unreleased product version (optional)

Related issues (optional)

Copy link
Contributor

claude bot commented Oct 4, 2025

PR Review

Thanks for adding thumbnail support to the RSS feed! However, there are several issues that need to be addressed:

Critical Issues

Line 2: Missing XML namespace declaration
The media:thumbnail element requires the Media RSS namespace to be declared. The <rss> tag should include:

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">

Line 18: Incorrect URL construction
The current URL construction concatenates RelPermalink with meta_image:

<media:thumbnail url="{{ .Site.Params.canonicalURL }}{{ .RelPermalink }}{{ .Params.meta_image }}" />

This produces URLs like https://pulumi.com/blog/post-name/meta.png. Since RelPermalink already includes a trailing slash for blog posts, this should work correctly. However, please verify this produces valid URLs by testing with actual blog posts.

Other Issues

PR metadata

  • The PR title "tmp" is not descriptive. Please update to something like "Add media:thumbnail support to blog RSS feed"
  • The PR description is empty. Please fill in the template with context about why this change is needed and how it was tested.

Testing Required

Before merging, please verify:

  1. The RSS feed validates correctly (use a validator like https://validator.w3.org/feed/)
  2. RSS readers correctly display the thumbnails
  3. URL construction works for various blog posts with different meta_image values
  4. The generated RSS file includes the media namespace declaration

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@seanyeh seanyeh changed the title tmp Add meta images to rss feed Oct 4, 2025
@seanyeh seanyeh marked this pull request as ready for review October 4, 2025 16:42
Copy link
Contributor

claude bot commented Oct 4, 2025

Pull Request Review

Issue Found

Line 18: Incorrect image URL construction

The current implementation concatenates the canonical URL, the post's relative permalink, and the meta_image path. This creates an incorrect URL structure.

For a blog post at /blog/my-post/ with meta_image: meta.png, the code generates:
https://www.pulumi.com/blog/my-post/meta.png

However, the meta_image parameter is typically just a filename (like meta.png) that lives alongside the index.md in a page bundle. The concatenation should work correctly since RelPermalink includes the trailing slash.

Verification Needed

Please verify:

  1. That meta_image paths work correctly for page bundles (e.g., meta.png in the same directory)
  2. That the HTML-encoded img tag renders properly in RSS readers
  3. Test with an actual RSS feed reader to confirm images display as intended

Technical Review

  • Formatting: Indentation and spacing are consistent with the template ✓
  • Newline: File ends with a newline ✓
  • Logic: Conditional check for .Params.meta_image is appropriate ✓
  • HTML encoding: Using HTML entities for the img tag is correct for RSS ✓

Recommendation

The implementation appears technically sound. The approach of embedding the image in the description using HTML is simpler and more compatible than media:content. Please test with your RSS reader to confirm the images display correctly before merging.

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