You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
472B

  1. use std::env;
  2. use errors::Result;
  3. use site::Site;
  4. use console;
  5. pub fn build(config_file: &str, base_url: Option<&str>, output_dir: &str) -> Result<()> {
  6. let mut site = Site::new(env::current_dir().unwrap(), config_file)?;
  7. site.set_output_path(output_dir);
  8. if let Some(b) = base_url {
  9. site.config.base_url = b.to_string();
  10. }
  11. site.load()?;
  12. console::notify_site_size(&site);
  13. console::warn_about_ignored_pages(&site);
  14. site.build()
  15. }