Add an example for generating sitemaps #2553
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Huge fan of Leptos and all the work everyone has done to make it the most fun web framework on the market. I recently rebuilt my website using Leptos and couldn't find an example (though I probably wasn't looking hard enought) for generating dynamic sitemaps. I thought it would be helpful for anyone looking to do the same on the websites they're building, especially for sites with lots of a pages. No harm done if the maintainers don't see any value in this example - this was purely for my use case.
The example is based on the Axum start template and uses sqlx for querying content, alongside the xml crate for generating the sitemap file.