mirror of
https://github.com/getzola/zola
synced 2024-12-14 14:22:28 +00:00
Merge pull request #550 from antonok-edm/next
add rendering for 404.html when running zola serve
This commit is contained in:
commit
daf1b4d92b
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue