diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 14012c12..cea3a9fd 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -327,6 +327,9 @@ impl Renderer for HtmlHandlebars { debug!("Register the index handlebars template"); handlebars.register_template_string("index", String::from_utf8(theme.index.clone())?)?; + debug!("Register the head handlebars template"); + handlebars.register_partial("head", String::from_utf8(theme.head.clone())?)?; + debug!("Register the header handlebars template"); handlebars.register_partial("header", String::from_utf8(theme.header.clone())?)?; diff --git a/src/theme/head.hbs b/src/theme/head.hbs new file mode 100644 index 00000000..cb1be187 --- /dev/null +++ b/src/theme/head.hbs @@ -0,0 +1 @@ +{{!-- Put your head HTML text here --}} diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 291e2796..9a0951a6 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -1,289 +1,315 @@ - - - - {{ title }} - {{#if is_print }} - - {{/if}} - - - - + + + + {{ title }} + {{#if is_print }} + + {{/if}} - - - - - + + {{> head}} - - - - + + + + - - - - + + + + + - - {{#each additional_css}} - - {{/each}} + + + + - {{#if mathjax_support}} - - - {{/if}} - - - - + + + + - - + {{/if}} + - if (sidebar.startsWith('"') && sidebar.endsWith('"')) { - localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1)); - } - } catch (e) { } - + + + - - + + - + if (sidebar.startsWith('"') && sidebar.endsWith('"')) { + localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1)); + } + } catch (e) { } + -
+ + -
- {{> header}} - -