From 779a15a5009aa13528eef7fb6d88bf1a3f1127f0 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sat, 9 Jan 2021 10:21:47 +0100 Subject: [PATCH] Pass lang to 404 Closes #1281 --- CHANGELOG.md | 3 ++- components/site/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35a1a451..876bcc3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.13.0 (unreleased) +## 0.13.0 (2021-01-09) - Enable HTML minification - Support `output_dir` in `config.toml` @@ -22,6 +22,7 @@ content - Update clojure syntax - Prefer extra syntaxes to the default ones if we have a match for language - Fix `zola serve` having issues with non-ascii paths +- 404 page now gets the site default language as `lang` ## 0.12.2 (2020-09-28) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index dd4b43a6..53720e57 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -770,6 +770,7 @@ impl Site { ensure_directory_exists(&self.output_path)?; let mut context = Context::new(); context.insert("config", &self.config); + context.insert("lang", &self.config.default_language); let output = render_template("404.html", &self.tera, context, &self.config.theme)?; let content = self.inject_livereload(output); self.write_content(&[], "404.html", content, false)?;