leptos/projects/sitemap_axum/README.md
2024-05-06 08:46:49 -04:00

947 B

Sitemaps with Axum

This project demonstrates how to serve a sitemap file using Axum using dynamic data (like blog posts in this case). An example Postgres database is used data source for storing blog post data that can be used to generate a dynamic site map based on blog post slugs. There's lots of sitemap crates, though this example uses the xml for example purposes.

Quick Start

We use Docker to provide a Postgres database for this sample, so make sure you have it installed.

$ docker -v
Docker version 25.0.3, build 4debf41

Once Docker has started on you local machine, run (make sure to have cargo-make installed):

$ cargo make run

This will handle spinning up a Postgres container, initializing the example database, and launching the local dev server.