disable_rss -> generate_rss in config

This commit is contained in:
Vincent Prouillet 2017-03-12 12:59:28 +09:00
parent dde9af3efd
commit 4e99389566
2 changed files with 9 additions and 6 deletions

View file

@ -21,8 +21,9 @@ pub struct Config {
pub description: Option<String>,
/// The language used in the site. Defaults to "en"
pub language_code: Option<String>,
/// Whether to disable RSS generation, defaults to false (== generate RSS)
pub disable_rss: Option<bool>,
/// Whether to generate RSS, defaults to false
pub generate_rss: Option<bool>,
/// All user params set in [extra] in the config
pub extra: Option<HashMap<String, Toml>>,
}
@ -44,8 +45,8 @@ impl Config {
config.highlight_code = Some(false);
}
if config.disable_rss.is_none() {
config.disable_rss = Some(false);
if config.generate_rss.is_none() {
config.generate_rss = Some(false);
}
Ok(config)
@ -71,7 +72,7 @@ impl Default for Config {
highlight_code: Some(true),
description: None,
language_code: Some("en".to_string()),
disable_rss: Some(false),
generate_rss: Some(false),
extra: None,
}
}

View file

@ -229,7 +229,9 @@ impl Site {
self.clean()?;
self.build_pages()?;
self.render_sitemap()?;
self.render_rss_feed()?;
if self.config.generate_rss.unwrap() {
self.render_rss_feed()?;
}
self.copy_static_directory()
}