Update site summary in zola check
This commit is contained in:
parent
28ecf553d5
commit
a923f7005f
|
@ -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(())
|
||||
}
|
||||
|
|
|
@ -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…
Reference in a new issue