-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-source-wordpress] Error in includedRoutes documentation ? #10871
Comments
Thank you for opening this @chawax 🙂 This definitely looks like an issue with the documentation. We would love to receive a pull request fixing this! Would you be interested? The file that needs to be updated is at https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/README.md |
Hello, is it okay if I can take this issue? |
I had no issues with the glob patterns of documentation. But I didn't exclude anything. Is this only relevant to routes of which some endpoints have been excluded? Like: includedRoutes: [
'/*/*/posts',
],
excludedRoutes: [
'/*/*/posts/1234',
], |
@chawax I just checked and currently documented route globs works for me (TM), but my routes looks like In either case there is no harm in adjusting docs to use @cardiv |
@pieh I set I saw |
@pieh, I'm using the plugin on a wordpress.com hosted site and I'm trying to include e.g. whitelist some routes.
In my case it ends up checking for example The working configuration: {
resolve: `gatsby-source-wordpress`,
options: {
baseUrl: `stoffwindelberatungjuliarose.wordpress.com`,
protocol: `https`,
hostingWPCOM: true,
useACF: false,
auth: {
// [...]
},
includedRoutes: ['/pages*', '/media*'],
},
} |
This is picking up the discussion on the routes documentation within gatsbyjs#10871 and the according pull request gatsbyjs#10887. It adds a test for a pattern that is working both on custom hosted WordPress API paths and on API paths from sites that are hosted on wordpress.com.
## Description Adds a test for a route blog pattern that is working both on custom hosted WordPress API paths and on API paths from sites that are hosted on wordpress.com. ## Related Issues This is picking up the discussion on the routes documentation within #10871 and the according pull request #10887.
Hi,
I try to use
includedRoutes
option ofgatsby-source-wordpress
plugin but could not make it work following the documentation here : https://www.gatsbyjs.org/packages/gatsby-source-wordpress/.I added these lines in my
gatsby-config.json
file :But when I run
gastby develop
and enable verbose output I have such unexpected messages :I debugged the plugin and found that the following method in
fetch.js
file :As you can see that this method uses the route path including base url (for example
https://mywebsite.com/wp-json/v2/posts
) and this doesn't match/*/*/posts
.I had to change
gatsby-config.js
this way to make it work :Is this an error in the documentation ? Or is there something I didn't understand ? (I am surprised I found nothing about this problem)
The text was updated successfully, but these errors were encountered: