leptos/projects/sitemap_axum
2024-08-10 20:01:41 -04:00
..
init projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
public projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
src Make get_configuration sync (#2647) 2024-08-01 19:42:49 -04:00
.env.example projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
.gitignore projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
Cargo.toml chore: upgrade dependencies (#2765) 2024-08-10 20:01:41 -04:00
LICENSE projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
Makefile.toml projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
README.md projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
rust-toolchain.toml projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
sitemap-index.xml projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00
sitemap-static.xml projects: add sitemap demo project (#2553) 2024-05-06 08:46:49 -04:00

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.