This commit is contained in:
parent
8a65aa3d77
commit
c2a9393ef1
2 changed files with 10 additions and 3 deletions
|
@ -21,6 +21,8 @@ pub struct FileConfig {
|
|||
pub onion: Option<String>,
|
||||
/// App name
|
||||
pub app_name: Option<String>,
|
||||
/// Name of website owner
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
impl FileConfig {
|
||||
|
@ -55,6 +57,7 @@ impl FileConfig {
|
|||
lang: test(a.lang, d.lang),
|
||||
onion: test(a.onion, d.onion),
|
||||
app_name: test(a.app_name, d.app_name),
|
||||
name: test(a.name, d.name),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,13 +196,18 @@ fn build_rss(config: Config, info: ConnectionInfo) -> String {
|
|||
}
|
||||
|
||||
let link_to_site = format!("{}://{}", info.scheme(), info.host());
|
||||
let author = if let (Some(mail), Some(name)) = (config.fc.mail, config.fc.name) {
|
||||
Some(format!("{mail} ({name})"))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let channel = Channel {
|
||||
title: "Blog d'Anri".into(),
|
||||
link: link_to_site.to_owned(),
|
||||
description: "Un fil qui parle d'informatique notamment".into(),
|
||||
language: Some("fr".into()),
|
||||
managing_editor: config.fc.mail.to_owned(),
|
||||
webmaster: config.fc.mail,
|
||||
managing_editor: author.to_owned(),
|
||||
webmaster: author,
|
||||
pub_date: Some(Local::now().to_rfc2822()),
|
||||
categories: ["blog", "blogging", "write", "writing"]
|
||||
.iter()
|
||||
|
@ -215,7 +220,6 @@ fn build_rss(config: Config, info: ConnectionInfo) -> String {
|
|||
docs: Some("https://www.rssboard.org/rss-specification".into()),
|
||||
image: Some(Image {
|
||||
url: format!("{}/icons/favicon-32x32.png", link_to_site),
|
||||
title: "Favicon".into(),
|
||||
link: link_to_site.to_owned(),
|
||||
..Image::default()
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue