diff --git a/components/rebuild/src/lib.rs b/components/rebuild/src/lib.rs index dad6ede3..ddc9668b 100644 --- a/components/rebuild/src/lib.rs +++ b/components/rebuild/src/lib.rs @@ -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 diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 76240229..61c42484 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -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), ) }