Update site summary in zola check

This commit is contained in:
Vincent Prouillet 2019-07-12 23:43:07 +02:00
parent 28ecf553d5
commit a923f7005f
2 changed files with 9 additions and 4 deletions

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.set_base_url(b.to_string());
} }
site.load()?; site.load()?;
console::notify_site_size_simple(&site); console::check_site_summary(&site);
console::warn_about_ignored_pages(&site); console::warn_about_ignored_pages(&site);
Ok(()) Ok(())
} }

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 /// 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 library = site.library.read().unwrap();
let orphans = library.get_all_orphan_pages();
println!( println!(
"-> {} pages ({} orphan), {} sections", "-> Site content: {} pages ({} orphan), {} sections",
library.pages().len(), 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 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 /// Display a warning in the console if there are ignored pages in the site