leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
15.31k stars 599 forks source link

Add an example for generating sitemaps #2553

Closed JoeyMckenzie closed 2 months ago

JoeyMckenzie commented 2 months ago

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.

sjud commented 2 months ago

This would make a good addition to the Projects directory! :) https://github.com/leptos-rs/leptos/tree/main/projects

JoeyMckenzie commented 2 months ago

@sjud Ah, good to know. Moved everything over to the project directory, thanks for calling that out!

gbj commented 2 months ago

Thanks!