From 4973c02554741514d972f42f2ff87eb6ffabb772 Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Mon, 16 Jan 2017 13:30:32 +0000 Subject: [PATCH] use chapter title + book title as page title --- data/_html-template/_layouts/page.hbs | 4 ++-- src/renderer/html_handlebars/hbs_renderer.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data/_html-template/_layouts/page.hbs b/data/_html-template/_layouts/page.hbs index 1e4a2ffb..db700877 100644 --- a/data/_html-template/_layouts/page.hbs +++ b/data/_html-template/_layouts/page.hbs @@ -2,7 +2,7 @@ - {{ title }} + {{ page-title }} @@ -63,7 +63,7 @@ {{#translation-links}}{{/translation-links}} -

{{ title }}

+

{{ page-title }}

diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 9d4f06b3..0b00a0e1 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -355,7 +355,8 @@ fn make_data(book: &Book, // Book data data.insert("language".to_owned(), "en".to_json()); - data.insert("title".to_owned(), book.config.title.to_json()); + data.insert("page-title".to_owned(), format!("{} - {}", chapter.title, book.config.title).to_json()); + data.insert("chapter-title".to_owned(), chapter.title.to_json()); data.insert("description".to_owned(), book.config.description.to_json()); if let Some(ref x) = *livereload_script {