-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working correctly with gatsby-plugin-sitemap #11
Comments
Hello! Are you using Gatsby 2 and the latest version of this plugin? I’m asking because we no longer use We replace all those occurrences with the correct path based on the depth of it, meaning that the URL inside the sitemap should be ok. Also be sure that the plugin is the last one from the plugin list. I may help you out if the project is public; if it is, send me your project repo and I can take a look. |
Hi, yes, I'm using gatsby 2.1.4 and gatsby-plugin-ipfs 2.0.2. The gatsby-config.js contains the pathPrefix: 'GATSBY_IPFS_PATH_PREFIX' and all links are correctly generated. The exception is the file sitemap.xml that is generated by the gatsby-plugin-sitemap. I'm sure the behavior is caused by the combination of gatsby-plugin-ipfs + gatsby-plugin-sitemap because if I disable gatsby-plugin-ipfs, but maintain the prefix-path, the URL content in sitemap.xml is generated as https://website.com/__GATSBY_IPFS_PATH_PREFIX__/page/ |
Understood. So, what you want is a way for this plugin to replace With that in mind, the best way is to implement an option where you pass an array of custom transforms, where each transform is something like: This would resolve your use-case and many others as well. Are you willing to do a PR that implements that option? Thanks! |
@wmitsuda bump. |
@satazor Hi, sorry for the delay.. I thought I'd have some time to take a look at the code, but I hadn't yet... |
I believe this is an issue of the order of the plugins are executed in the gatsby-config of your project. This plugin uses onpostbuild which means it really should run after all other plugins have done their thing. I don't mean to come across as an authority as I'm only 1 year into gatsby on side projects. Sooo...I'm not 100% certain but IF this plugin were listed below the sitemap plugin in gatsby-config you may not get this error - but you will likely have an invalid sitemap (if I'm reading this plugin's code correctly as it seems like this plugin is also making changes onPrebootstrap. I'm thinking this should really be two plugins -one for the onprebootstrap and one for the post build because the onprebootstrap will not have run before the sitemap plugin if this plugin is listed last in your gatsby-config. I could be totally wrong here but thought I'd chime in. |
I'm trying to generate sitemaps using the plugin gatsby-plugin-sitemap, but the generated URLs are like this: https://website.com./page/
Note the trailing dot after the domain. The gatsby-plugin-sitemap is before the gatsby-plugin-ipfs in gatsby-config.js just for information.
Not sure if there is something that can be done from gatsby-plugin-ipfs side.
The text was updated successfully, but these errors were encountered: