You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be great if this library could automatically fill in the <lastmod> time in the generated sitemap based on either the datetime the source route file was modified (probably won't work if you clone a fresh git repo since all files will have the same datetime?) or maybe the datetime the file was last modified in git or something.
The text was updated successfully, but these errors were encountered:
This is a little bit tricky, because the sitemap is generated on postbuild hook, so it is always based on newly generated static files.
There would have to be some mapping to the original files...
And there are also dynamically generated routes [slug].svelte, from which date information cannot be taken.
Another thing is that the route itself often consists of a child component. So there would have to be complex traversal to other files as well.
In summary, I would say that this solution will never be completely reliable and is not worth the effort 🤨
Let's keep it simple 😄
Or do you have a better idea? I'd love to hear it.
Yeah, that all makes sense. And yeah, too complicated. Thanks for considering it.
What about my other idea of introspecting git information? Git already has a diffing mechanism for static files so you could perhaps get the last time each build/**.html file was modified in git and put that in the sitemap? Maybe a --use-git-lastmod option?
It would be a little unfortunate that this feature would only work with projects that are stored in Git, but for me it would be better than manually updating the <lastmod> fields every time.
Glench
changed the title
[New Feature Request] Automatically set lastmod by looking up mtime of /src/routes/*.svelte
[New Feature Request] Automatically set lastmod in sitemap
Jan 31, 2022
It'd be great if this library could automatically fill in the
<lastmod>
time in the generated sitemap based on either the datetime the source route file was modified (probably won't work if you clone a fresh git repo since all files will have the same datetime?) or maybe the datetime the file was last modified in git or something.The text was updated successfully, but these errors were encountered: