Comments (3)
That would be a very nice feature!!! PRs are very welcome 😃
from gatsby-plugin-advanced-sitemap.
I have the opposite problem - I have one query and want to be able to split it into multiple sitemaps. Can this be achieved?
Example:
query: `
allSitePage { ... }
`,
mapping: {
allSitePage: {
sitemap: `products`, // by filtering the query result with some logic
sitemap: `category`, // by filtering the query result with some logic
sitemap: ...
}
}
Also let me know if this belongs to a new Issues entry!
from gatsby-plugin-advanced-sitemap.
@fmaiabatista you could theoritically just use aliases in your gql to bypass this I think.
query: `{
products: allSitePage { ... }
category: allSitePage { ... }
}`
I agree with the OP. Being able to combine queries into one would be super useful. Only way around this I can think of would be to create a new set of nodes using sourceNodes
with the combined queries then querying those new nodes that way.
@aileen would that work?
This could also be solved by allowing a top level serializer
rather than on each individual query, so on the top level query, which you would then return the objects for creating the sitemaps.
It would go something like:
query: `{
categories: {...}
products: {...}
}`,
serializer: (({ products, categories }) => {
const productMap = products.map(...)
const categoriesMap = categories.map(...)
return {
["name_of_sitemap"]: productMap,
["categories_sitemap"]: categoriesMap
}
})
Just as an example.
from gatsby-plugin-advanced-sitemap.
Related Issues (20)
- Error querying gatsby-source-graphql plugin HOT 2
- Example of Serializer Output Needed HOT 3
- Make excludes more intuitive HOT 3
- V2: Ideas and Umbrella ☂ HOT 5
- warn Plugin gatsby-plugin-advanced-sitemap is not compatible with your gatsby version 3.1.0 HOT 4
- Serializer: more detailed docs / examples / confirmation it works HOT 3
- Some pages are missing in the sitemap
- Only one page logged in sitemap-pages.xml HOT 2
- Peformance Problems HOT 2
- Dependency Dashboard
- Peer dependency compatibility with Gatsby 4.0 HOT 10
- Setting `assetPrefix` prefixes xml files but not xsl (results in broken sitemap)
- Adding `addUncaughtPages` ignores `prefix` and `serializer` options
- Undefined URLs in sitemap with Ghost HOT 6
- Google can't parse this sitemap HOT 1
- Trailing slashes are being removed automatically HOT 6
- Gatsby v5 support HOT 1
- Incorrect link to sitemap.xsl when using custom output path HOT 1
- Trailing slash support (given it's now default on Gatsby). HOT 7
- Showing Undefined url path in sitemaps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-advanced-sitemap.