Merge pull request #550 from antonok-edm/next

add rendering for 404.html when running zola serve
This commit is contained in:
Vincent Prouillet 2018-12-10 17:44:26 +01:00 committed by GitHub
commit daf1b4d92b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -352,6 +352,7 @@ pub fn after_template_change(site: &mut Site, path: &Path) -> Result<()> {
site.render_orphan_pages()
}
"section.html" => site.render_sections(),
"404.html" => site.render_404(),
// Either the index or some unknown template changed
// We can't really know what this change affects so rebuild all
// the things

View file

@ -627,9 +627,10 @@ impl Site {
ensure_directory_exists(&self.output_path)?;
let mut context = Context::new();
context.insert("config", &self.config);
let output = render_template("404.html", &self.tera, &context, &self.config.theme)?;
create_file(
&self.output_path.join("404.html"),
&render_template("404.html", &self.tera, &context, &self.config.theme)?,
&self.inject_livereload(output),
)
}