From 6788225f0f7be8f35dbcc0fcd498698c49f94326 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 27 Dec 2024 22:44:47 +0100 Subject: fix(back): add correct links to rss feed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Silas Schöffel --- pkgs/by-name/ba/back/src/config/mod.rs | 3 +++ pkgs/by-name/ba/back/src/web/mod.rs | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ba/back/src/config/mod.rs b/pkgs/by-name/ba/back/src/config/mod.rs index a680b90..7351ad8 100644 --- a/pkgs/by-name/ba/back/src/config/mod.rs +++ b/pkgs/by-name/ba/back/src/config/mod.rs @@ -25,12 +25,14 @@ pub struct BackConfig { // `` of all kinds _should_ be invalid. <2024-12-26> pub source_code_repository_url: Url, pub repository: ThreadSafeRepository, + pub root: Url, } #[derive(Deserialize)] struct RawBackConfig { source_code_repository_url: Url, repository_path: PathBuf, + root_url: Url, } impl BackConfig { @@ -64,6 +66,7 @@ impl TryFrom for BackConfig { Ok(Self { repository, source_code_repository_url: value.source_code_repository_url, + root: value.root_url, }) } } diff --git a/pkgs/by-name/ba/back/src/web/mod.rs b/pkgs/by-name/ba/back/src/web/mod.rs index c7ba9d9..968c827 100644 --- a/pkgs/by-name/ba/back/src/web/mod.rs +++ b/pkgs/by-name/ba/back/src/web/mod.rs @@ -119,14 +119,15 @@ pub fn feed(config: &State) -> error::Result> { .author(issue.author.to_string()) .description(issue.message.to_string()) .pub_date(issue.timestamp.to_string()) + .link(format!("{}/issue/{}", &config.root.to_string(), issue.id)) .build() }) .collect(); let channel = ChannelBuilder::default() .title("Issues") - .link("http://example.com") - .description("An RSS feed.") + .link(config.root.to_string()) + .description(format!("The rss feed for issues on {}.", config.root)) .items(items) .build(); Ok(RawHtml(channel.to_string())) -- cgit 1.4.1