Is it possible to use a serializer in the mapping section? I (maybe not so brightly) have all my post types as one.
{
resolve: `gatsby-plugin-advanced-sitemap`,
options: {
// 1 query for each data type
query: `
{
allSanityPost(filter: {slug: {current: {ne: "null"}}, postType: {title: {in: ["blog"]}}, publishedAt: {ne: "null"}}) {
edges {
node {
id
title
publishedAt
slug {
current
}
postType {
title
}
series {
slug {
current
}
}
}
}
}
allSanityPost(filter: {slug: {current: {ne: "null"}}, postType: {title: {in: ["lesson"]}}, publishedAt: {ne: "null"}}) {
edges {
node {
id
title
publishedAt
slug {
current
}
postType {
title
}
series {
slug {
current
}
}
}
}
}
allSanityPost(filter: {slug: {current: {ne: "null"}}, postType: {title: {in: ["course"]}}, publishedAt: {ne: "null"}}) {
edges {
node {
id
title
publishedAt
slug {
current
}
postType {
title
}
series {
slug {
current
}
}
}
}
}
allSanityAuthor {
edges {
node {
id
slug {
current
}
name
image {
asset {
url
}
}
}
}
}
}`,
mapping: {
// Each data type can be mapped to a predefined sitemap
// Routes can be grouped in one of: posts, tags, authors, pages, or a custom name
// The default sitemap - if none is passed - will be pages
allGhostPost: {
sitemap: `posts`,
},
allGhostTag: {
sitemap: `tags`,
},
allGhostAuthor: {
sitemap: `authors`,
},
allGhostPage: {
sitemap: `pages`,
},
},
exclude: [
`/dev-404-page`,
`/404`,
`/404.html`,
`/offline-plugin-app-shell-fallback`,
`/my-excluded-page`,
/(\/)?hash-\S*/, // you can also pass valid RegExp to exclude internal tags for example
],
createLinkInHead: true, // optional: create a link in the `<head>` of your site
addUncaughtPages: true, // optional: will fill up pages that are not caught by queries and mapping and list them under `sitemap-pages.xml`
}