Browse Source

disable_rss -> generate_rss in config

index-subcmd
Vincent Prouillet 7 years ago
parent
commit
4e99389566
2 changed files with 9 additions and 6 deletions
  1. +6
    -5
      src/config.rs
  2. +3
    -1
      src/site.rs

+ 6
- 5
src/config.rs 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,
}
}


+ 3
- 1
src/site.rs 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()
}



Loading…
Cancel
Save