fix(rss): absolute item/channel links, atom self, application/xml
Some checks failed
CI / Check / Test (push) Failing after 30m12s

This commit is contained in:
2026-10-25 19:59:07 +01:00
parent 4f3d99ec8e
commit 2ce7db12c2
7 changed files with 148 additions and 19 deletions

View File

@@ -1,5 +1,19 @@
use crate::models::DiaryEntry;
pub trait RssFeedRenderer: Send + Sync {
fn render_feed(&self, entries: &[DiaryEntry], title: &str) -> Result<String, String>;
/// Channel-level metadata for a rendered feed. Paths are site-relative
/// (e.g. `/users/{id}`); the renderer resolves them against its base URL.
pub struct FeedChannel<'a> {
pub title: &'a str,
/// Human-readable page the channel represents.
pub link_path: &'a str,
/// Where the feed itself is served, advertised as `atom:link rel="self"`.
pub self_path: &'a str,
}
pub trait RssFeedRenderer: Send + Sync {
fn render_feed(
&self,
entries: &[DiaryEntry],
channel: &FeedChannel<'_>,
) -> Result<String, String>;
}