Support Overrides in gatsby-plugin-canonical-urls #26978
Replies: 4 comments 1 reply
-
Could you use |
Beta Was this translation helpful? Give feedback.
-
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Beta Was this translation helpful? Give feedback.
-
Bumping this discussion as I currently have the same issue. We have a few landing pages that we wish to have the canonical URL as the homepage of our website, not the url of the landing page itself. |
Beta Was this translation helpful? Give feedback.
-
I've created pull request #38872 which adds an option |
Beta Was this translation helpful? Give feedback.
-
Summary
I would like to introduce an
overrides
option ingatsby-plugin-canonical-urls
. This plugin is really useful for adding the canonical tag across all the pages created in Gatsby. But it has an all-or-nothing approach about it. If I want just one page to reference another page, then I need to remove this plugin and manually add a canonical URL to every page.My proposal for an
overrides
tag will make this easier. I am not attached to the labeloverrides
, if there is a better term for this (perhapsoriginalReferences
?). Also, I am happy to enter a PR myself, although I have not contributed to this repo before, so I could use a little guidance.Basic example
Currently the plugin,
gatsby-plugin-canonical-urls
, supports two options:siteUrl
andstripQueryString
I would like to see a third option that is
overrides
. This would then look like the following:All URLs not specified in this
overrides
object will operate using the existing logic.Motivation
The hope is to make this plugin more flexible and therefore more sticky. I am currently using this plugin, and now that I have one page with some duplicate content, I need to remove this plugin and add react-helmet to every one of my pages.
I did a bit of research and I couldn't find anything, but let me know if there is already an existing, better alternative. I'm happy to hear feedback.
Beta Was this translation helpful? Give feedback.
All reactions