From 279b5109e800301d3b8119058f0d8a9f92af92cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Mon, 24 May 2021 23:12:14 -0300 Subject: [PATCH 1/2] WIP: import latest theme from mdBook. Need to filter what we actually need from this file, but it includes accessibility and navigation fixes, plus the additions necessary for edit-url-template [1] to work. [1] https://github.com/rust-lang/mdBook/pull/1506 --- src/theme/index.hbs | 385 +++++++++++++++++++++++++++++++------------- 1 file changed, 270 insertions(+), 115 deletions(-) diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 239c9c572..966eedbce 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -1,133 +1,223 @@ - + - + {{ title }} + {{#if is_print }} + + {{/if}} + {{#if base_url}} + + {{/if}} + + + + {{> head}} + + - + {{#if favicon_svg}} + + {{/if}} + {{#if favicon_png}} + + {{/if}} + + + {{#if print_enable}} + {{/if}} + + + + {{#if copy_fonts}} + + {{/if}} + + + + + + + + {{#each additional_css}} + + {{/each}} + + {{#if mathjax_support}} + + + {{/if}} - - - -
- -
- -
- - - - - - - - - -
- {{#if search_enabled}} - - {{/if}} - -
- {{{ content }}} -
- - -
-
+ + + + + + + + + + + + +
+ +
+ {{> header}} + + + + {{#if search_enabled}} + + {{/if}} + + + + +
+
+ {{{ content }}} +
+ + +
+
+ + + +
{{#if livereload}} @@ -136,7 +226,7 @@ socket.onmessage = function (event) { if (event.data === "reload") { socket.close(); - location.reload(true); // force reload from server (not from cache) + location.reload(); } }; @@ -146,12 +236,77 @@ {{/if}} + {{#if google_analytics}} + + + {{/if}} + + {{#if playground_line_numbers}} + + {{/if}} + + {{#if playground_copyable}} + + {{/if}} + + {{#if playground_js}} + + + + + + {{/if}} + {{#if search_js}} {{/if}} + + + + + {{#each additional_js}} + + {{/each}} + + {{#if is_print}} + {{#if mathjax_support}} + + {{else}} + + {{/if}} + {{/if}} + From f1b98e344f94fe25562456fa9c6dcb25d7799d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Mon, 24 May 2021 23:14:27 -0300 Subject: [PATCH 2/2] book.toml: add edit-url-template and git-repository-url Makes it possible to get to an editing page or to the repo for void-docs from any page with a single click. --- book.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/book.toml b/book.toml index 70109aa49..308ed4aab 100644 --- a/book.toml +++ b/book.toml @@ -6,6 +6,8 @@ title = "Void Linux Handbook" [output.html] theme = "src/theme" +git-repository-url = "https://github.com/void-linux/void-docs" +edit-url-template = "https://github.com/void-linux/void-docs/edit/master/{path}" [output.html.redirect] "/about-this-handbook.html" = "/about/about-this-handbook.html"