From 4b0b4d064cb0106bb2c5d4f4858fcea21600333e Mon Sep 17 00:00:00 2001 From: tilpner Date: Mon, 1 Jun 2020 15:26:27 +0200 Subject: rss: add content namespace --- src/generate.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/generate.rs b/src/generate.rs index 36f05f3..4ed1de0 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -1,5 +1,6 @@ use std::{ - fs::{ self, File } + fs::{ self, File }, + collections::HashMap }; use sqlx::prelude::*; @@ -222,6 +223,13 @@ pub async fn run(mut conn: &mut Conn, opts: GenerateOpts) -> Result<()> { channel.pub_date(Utc::now().to_rfc2822()); channel.items(rss_items); + channel.namespaces({ + let mut ns = HashMap::new(); + ns.insert("content".to_owned(), + "http://purl.org/rss/1.0/modules/content/".to_owned()); + ns + }); + let channel = channel.build().expect("Failed to build RSS channel"); let channel_path = feed_directory.join("rss.xml"); let mut out_file = File::create(channel_path)?; -- cgit v1.2.3