ask for owner name
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-26 16:21:57 +02:00
parent 8a65aa3d77
commit c2a9393ef1
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 10 additions and 3 deletions

View file

@ -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),
}
}
}

View file

@ -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()
}),