| name | Extension: Content Feeds |
| description | RssFeedProvider and SitemapProvider trait implementations for SEO and content syndication |
Extension: Content Feeds
Feed providers generate RSS feeds and XML sitemaps for search engine optimization and content syndication. All traits live in crates/shared/provider-contracts/src/.
1. RssFeedProvider
Generates RSS 2.0 feeds from content sources.
Trait
#[async_trait]
pub trait RssFeedProvider: Send + Sync {
fn feed_specs(&self) -> Vec<RssFeedSpec>;
async fn feed_metadata(&self, ctx: &dyn RssFeedContext) -> Result<RssFeedMetadata>;
async fn fetch_items(&self, ctx: &dyn RssFeedContext, limit: usize) -> Result<Vec<RssFeedItem>>;
}
Feed Spec Fields
| Field | Type | Description |
|---|
source | String | Content source to query |
path | String | URL path for the feed (e.g., /feed.xml) |
limit | usize | Maximum items in feed |
Registration
impl Extension for MyExtension {
fn rss_feed_providers(&self) -> Vec<Arc<dyn RssFeedProvider>> {
vec![Arc::new(BlogRssFeedProvider)]
}
}
2. SitemapProvider
Generates XML sitemaps for search engine indexing.
Trait
#[async_trait]
pub trait SitemapProvider: Send + Sync {
fn source_specs(&self) -> Vec<SitemapSourceSpec>;
fn static_urls(&self, base_url: &str) -> Vec<SitemapUrlEntry>;
async fn resolve_placeholders(
&self,
ctx: &dyn SitemapContext,
content: &[ContentItem],
placeholders: &[String],
) -> Result<Vec<SitemapUrlEntry>>;
}
Sitemap URL Entry Fields
| Field | Type | Description |
|---|
loc | String | Full URL |
lastmod | Option<DateTime> | Last modification date |
changefreq | Option | daily, weekly, monthly, yearly, never |
priority | Option | 0.0 to 1.0 (default: 0.5) |
Registration
impl Extension for MyExtension {
fn sitemap_providers(&self) -> Vec<Arc<dyn SitemapProvider>> {
vec![Arc::new(BlogSitemapProvider)]
}
}
3. SEO Best Practices
| Practice | Implementation |
|---|
Sitemap at /sitemap.xml | Registered by SitemapGenerationJob |
RSS at /feed.xml | Standard feed location |
robots.txt references sitemap | Generated by RobotsTxtGenerationJob |
lastmod reflects actual changes | Use updated_at, not created_at |
| Priority reflects page importance | Homepage: 1.0, blog list: 0.8, posts: 0.7 |
4. Rules
| Rule | Rationale |
|---|
All providers are Send + Sync | Async multi-threaded context |
| RSS items sorted by date descending | Most recent first |
| Sitemap URLs must be absolute | Include full base_url prefix |
| Feed limits default to 20 items | Standard RSS practice |
Use DateTime<Utc> for dates | RFC 2822 for RSS, ISO 8601 for sitemap |