gatsby-plugin-feed requires creating slugs for pages

Created on 25 Feb 2019  路  9Comments  路  Source: gatsbyjs/gatsby

This is probably obvious to many, but while adding gatsby-plugin-feed to my site I discovered that you must add slugs to your MarkdownReact nodes.

The documentation for how to do this is very clear: https://www.gatsbyjs.org/docs/creating-slugs-for-pages/

What wasn't clear (to me) was that this was a dependency for gatsby-plugin-feed.

I hope this helps others...

good first issue help wanted stale? confirmed bug

Most helpful comment

@johnreynoldsventure

What wasn't clear (to me) was that this was a dependency for gatsby-plugin-feed.

Your are right. :) gatsby-plugin-feed require slug by default.
=> here is the code where plugin use slug to define each page url.

But you can costomize it by passing option into gatsby-config.js.

In my example I try to change default site url from https://example.com/${slug} to https://example.com/posts/${slug} in feed.
=> here is the code.

All 9 comments

The plugin shouldn't work this way. You should pass into the configuration which field to use does the slug. Would you be interested in working on a PR for this?

I'd love to help more Kyle, but I fear I don't know enough - I'm just getting started with gatsby.
I started with the gatsby tutorial, and have been added functionality as I need it. Likely my problems are due to me missing a step or two along the way rather than anything fundamental.

@johnreynoldsventure

What wasn't clear (to me) was that this was a dependency for gatsby-plugin-feed.

Your are right. :) gatsby-plugin-feed require slug by default.
=> here is the code where plugin use slug to define each page url.

But you can costomize it by passing option into gatsby-config.js.

In my example I try to change default site url from https://example.com/${slug} to https://example.com/posts/${slug} in feed.
=> here is the code.

I'll like to work on a PR @KyleAMathews. Can you point me on the write direction?

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!

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

I think this should be fixed by updating the docs stating that the default serializer requires a slug field, rather than any change to the plugin.

@VGoose we actually did that recently -> https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-feed#how-to-use

(We don't note what you need to do to use the internal serialize, just that we recommend you write your own!)

@DSchau any reason to not be explicit about the requirements of the default serializer? The issue was opened because it wasn't clear.

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.

Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

totsteps picture totsteps  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

andykais picture andykais  路  3Comments