From 4e99389566c6efd7115e7917e11914ad99aa7456 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sun, 12 Mar 2017 12:59:28 +0900 Subject: [PATCH] disable_rss -> generate_rss in config --- src/config.rs | 11 ++++++----- src/site.rs | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index ec26c617..c2c108d0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,8 +21,9 @@ pub struct Config { pub description: Option, /// The language used in the site. Defaults to "en" pub language_code: Option, - /// Whether to disable RSS generation, defaults to false (== generate RSS) - pub disable_rss: Option, + /// Whether to generate RSS, defaults to false + pub generate_rss: Option, + /// All user params set in [extra] in the config pub extra: Option>, } @@ -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, } } diff --git a/src/site.rs b/src/site.rs index 5931e4a7..3bd3e622 100644 --- a/src/site.rs +++ b/src/site.rs @@ -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() }