Browse Source

Update site summary in zola check

index-subcmd
Vincent Prouillet 4 years ago
parent
commit
a923f7005f
2 changed files with 9 additions and 4 deletions
  1. +1
    -1
      src/cmd/check.rs
  2. +8
    -3
      src/console.rs

+ 1
- 1
src/cmd/check.rs View File

@@ -15,7 +15,7 @@ pub fn check(config_file: &str, base_path: Option<&str>, base_url: Option<&str>)
site.set_base_url(b.to_string());
}
site.load()?;
console::notify_site_size_simple(&site);
console::check_site_summary(&site);
console::warn_about_ignored_pages(&site);
Ok(())
}

+ 8
- 3
src/console.rs View File

@@ -59,14 +59,19 @@ pub fn notify_site_size(site: &Site) {
}

/// Display in the console only the number of pages/sections in the site
pub fn notify_site_size_simple(site: &Site) {
pub fn check_site_summary(site: &Site) {
let library = site.library.read().unwrap();
let orphans = library.get_all_orphan_pages();
println!(
"-> {} pages ({} orphan), {} sections",
"-> Site content: {} pages ({} orphan), {} sections",
library.pages().len(),
site.get_number_orphan_pages(),
orphans.len(),
library.sections().len() - 1, // -1 since we do not count the index as a section there
);

for orphan in orphans {
warn(&format!("Orphan page found: {}", orphan.path));
}
}

/// Display a warning in the console if there are ignored pages in the site


Loading…
Cancel
Save