zola/src/cmd/build.rs

19 lines
468 B
Rust
Raw Normal View History

use std::env;
2017-07-01 07:47:41 +00:00
use errors::Result;
use site::Site;
2016-12-13 06:22:24 +00:00
use console;
2016-12-06 08:27:03 +00:00
pub fn build(config_file: &str, base_url: Option<&str>, output_dir: &str) -> Result<()> {
let mut site = Site::new(env::current_dir().unwrap(), config_file)?;
site.set_output_path(output_dir);
if let Some(b) = base_url {
site.set_base_url(b.to_string());
}
2017-03-21 07:57:00 +00:00
site.load()?;
console::notify_site_size(&site);
console::warn_about_ignored_pages(&site);
2017-03-20 10:00:00 +00:00
site.build()
2016-12-13 09:05:59 +00:00
}