Add book title to 404 page title.
This commit is contained in:
parent
97cb77bbdd
commit
675c8c3f4e
|
@ -170,7 +170,13 @@ impl HtmlHandlebars {
|
||||||
// Set a dummy path to ensure other paths (e.g. in the TOC) are generated correctly
|
// Set a dummy path to ensure other paths (e.g. in the TOC) are generated correctly
|
||||||
data_404.insert("path".to_owned(), json!("404.md"));
|
data_404.insert("path".to_owned(), json!("404.md"));
|
||||||
data_404.insert("content".to_owned(), json!(html_content_404));
|
data_404.insert("content".to_owned(), json!(html_content_404));
|
||||||
data_404.insert("title".to_owned(), json!("Page not found"));
|
|
||||||
|
let mut title = String::from("Page not found");
|
||||||
|
if let Some(book_title) = &ctx.config.book.title {
|
||||||
|
title.push_str(" - ");
|
||||||
|
title.push_str(book_title);
|
||||||
|
}
|
||||||
|
data_404.insert("title".to_owned(), json!(title));
|
||||||
let rendered = handlebars.render("index", &data_404)?;
|
let rendered = handlebars.render("index", &data_404)?;
|
||||||
|
|
||||||
let rendered =
|
let rendered =
|
||||||
|
|
Loading…
Reference in New Issue