Skip to content
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

Add new sitemap for images to resolve indexing issues with webp images #1389

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
27 changes: 27 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,34 @@ module.exports = {
{
resolve: 'gatsby-plugin-sitemap',
options: {
output: `/sitemap-index`,
excludes: DISLALLOW_LIST,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just saw this. Can you rename

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik it should match the other sitemaps, which are currently only on sitemap-index. sitemap-index should collect all sitemaps though, so I'll change and see what happens

Copy link
Contributor

@Xantier Xantier Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant the typo here. DIESEL-ALLOW

Copy link
Contributor Author

@samnixon87 samnixon87 Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A DT var that I didn't catch. Changed

query: `
{
allSitePage {
nodes {
path
}
}
allFile(filter: { extension: { regex: "/(jpg|jpeg|png|webp)/" } }) {
nodes {
publicURL
}
}
}
`,
serialize: ({ path, allFile }) => {
const images = allFile.nodes.map((node) => ({
url: `https://roadie.io${node.publicURL}`,
}));

return {
url: path,
changefreq: `daily`,
priority: 0.7,
images,
};
},
},
},

Expand Down
Loading