Gatsby: RSS/Atom Feeds should use absolute URLs to be standards-compliant

Created on 18 May 2019  路  6Comments  路  Source: gatsbyjs/gatsby

Description

I found a ("hacky", as he himself describes it) workaround on Dan Abramov's blog:

https://github.com/gaearon/overreacted.io/issues/65

The workaround is based on string replacement though, which would replace false-positives such as matches within code blocks. I'm also not sure whether href and src cover every use of urls in the html spec.

Steps to reproduce

  • Go to https://gatsby-starter-blog-demo.netlify.com/rss.xml
  • Search for salty_egg

Expected result

  • href="https://gatsby-starter-blog-demo.netlify.com/static/8058f3f26913fea3b6a89a73344fe94a/2b40c/salty_egg.jpg"
  • src="https://gatsby-starter-blog-demo.netlify.com/static/8058f3f26913fea3b6a89a73344fe94a/c739e/salty_egg.jpg"

Actual result

  • href="/static/8058f3f26913fea3b6a89a73344fe94a/2b40c/salty_egg.jpg"
  • src="/static/8058f3f26913fea3b6a89a73344fe94a/c739e/salty_egg.jpg"
help wanted not stale confirmed rss-feed feature or enhancement

Most helpful comment

Hi!

Thanks a lot for filing this issue! I wonder if you would like to make a PR to gatsby-plugin-feed to fix that?

Thank you! :purple_heart:

All 6 comments

Hi!

Thanks a lot for filing this issue! I wonder if you would like to make a PR to gatsby-plugin-feed to fix that?

Thank you! :purple_heart:

@freiksenet you're welcome :) I'd love to help, yes. I will probably have time to write that PR in a week or two if waiting that long is ok.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Ran into this one today. @agentofuser how did you get on with the PR?

I'd be happy to take a crack at it, but I don't understand the code well enough. Can anyone lend a bit of insight to help get me started?

Found a great blog article that describes how to replace the relative URL with absolute URL in the RSS feed while this issue gets sorted out:
https://markshust.com/2020/06/25/fixing-images-in-gatsby-rss-feeds/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theduke picture theduke  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments

brandonmp picture brandonmp  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

timbrandin picture timbrandin  路  3Comments