Browse Source

Pass lang to 404

Closes #1281
master
Vincent Prouillet 9 months ago
parent
commit
779a15a500
  1. 3
      CHANGELOG.md
  2. 1
      components/site/src/lib.rs

3
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)

1
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)?;

Loading…
Cancel
Save