Replies: 4 comments 18 replies
-
Hi @mkbctrl, Thank you for highlighting this. I am not aware of that and I think I will definitely make it an addition then, at least with the Prismic CMS data there is an updated date field that can be passed in. At the moment, there is the option to use the I am thinking then that I could make that then a function that can have the current document passed in, but also still be backwards compatible with the object only version. So something like this: // next.config.js
module.exports = withPrismicSitemap({
sitemap: {
// ... other cofing
optionsMapPerDocumentType: {
post: (doc) => {
return {
lastmod: doc.last_publication_date ? doc.last_publication_date : (new Date()).toJSON(),
// below for any older things that use it
changefreq: "weekly",
priority: 0.8
};
}
},
}
}) I will have to have a look at this then as a very useful and practical feature, thank you for highlighting it 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi @mkbctrl, I have added the option to allow a callback to be placed inside the options map. There is also the addition to allow someone to place the usage of static paths in an array for them to be added to the list of the sitemap entries. If you would like to test it, it will be available as If you would like you can test it and let me know if it is coming out alright for you too. You can see PR #10 for the changes that have been added and also the branch |
Beta Was this translation helpful? Give feedback.
-
One not related issue, while trying to install your package in alpha version I was forced to switch to node v12, by default I run LTS v14. If it's not required by dependencies, maybe it's worth to change. |
Beta Was this translation helpful? Give feedback.
-
Hi @mkbctrl Hope you are good, I released v0.3.0 yesterday with these additions and fixes, so if you would like that is the version that will get updates for any fixes now. (I won't push an alpha for that version now) Hope it works and please let me know if there are any issues or feel free to open an issue if you would like to put more details in 👍 |
Beta Was this translation helpful? Give feedback.
-
Recently I was updating few sitemaps in order to meet updated google's requirements, where the
changefreq
andpriority
fields are kind of obsolete.First I stumbled upon this information while working with another project in GatsbyJs:
source: https://www.gatsbyjs.com/plugins/gatsby-plugin-sitemap/
direct source: https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap
Since I used your plugin today, I thought I will share this info with you, as I don't see this field in the output file. Hope you find it useful.
Btw, it's a great plugin, and thanks for saving me a lot of work ❤️
P.S. I am about to have a look how to add the
lastmod
field into your sitemap, hopefully I will be able to share some more insights.Beta Was this translation helpful? Give feedback.
All reactions