Skip to main content

register_sitemap_source

Macro register_sitemap_source 

Source
macro_rules! register_sitemap_source {
    ($ty:ty) => { ... };
}
Expand description

Register a SitemapSource. Pair with a Default impl.

ⓘ
#[derive(Default)]
struct DocsSource;
#[async_trait::async_trait]
impl rustango_cms::sitemap::SitemapSource for DocsSource {
    async fn entries(&self, _pool: &rustango::sql::Pool, base: &str)
        -> Vec<rustango_cms::sitemap::SitemapEntry> {
        vec![rustango_cms::sitemap::SitemapEntry::new(format!("{base}/docs"))
            .with_changefreq("weekly")]
    }
}
rustango_cms::register_sitemap_source!(DocsSource);