From d51206596e2b65f37a6bf0719004daa6bc8b45ad Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:53:04 +0200 Subject: [PATCH] fix(theme): Fix side menu being stuck open and obscuring most of the page --- book.toml | 7 +- .../css/language-picker.css | 5 + theme/head.hbs | 26 + theme/index.hbs | 363 +++-- third_party/mdbook/book.js | 1312 +++++++++-------- 5 files changed, 930 insertions(+), 783 deletions(-) rename language-picker.css => theme/css/language-picker.css (59%) create mode 100644 theme/head.hbs diff --git a/book.toml b/book.toml index f2bf36d9..b68ec0c0 100644 --- a/book.toml +++ b/book.toml @@ -23,7 +23,7 @@ site-url = "/patterns/" git-repository-url = "https://github.com/rust-unofficial/patterns" git-repository-icon = "fa-github" edit-url-template = "https://github.com/rust-unofficial/patterns/edit/main/{path}" -additional-css = ["./language-picker.css"] +additional-css = ["theme/css/language-picker.css"] [output.html.fold] enable = true @@ -33,3 +33,8 @@ level = 1 editable = false # [output.linkcheck] # enable the "mdbook-linkcheck" renderer, disabled due to gh-actions + +[output.html.redirect] +# Redirects in the form of "old-path" = "new-path", where the new path +# is relative to the old path. +"functional/lenses.html" = "optics.html" diff --git a/language-picker.css b/theme/css/language-picker.css similarity index 59% rename from language-picker.css rename to theme/css/language-picker.css index 1f7d5377..1553ed68 100644 --- a/language-picker.css +++ b/theme/css/language-picker.css @@ -3,6 +3,11 @@ right: 10px; } +[dir="rtl"] #language-list { + left: 10px; + right: auto; +} + #language-list a { color: inherit; } diff --git a/theme/head.hbs b/theme/head.hbs new file mode 100644 index 00000000..8432ff2e --- /dev/null +++ b/theme/head.hbs @@ -0,0 +1,26 @@ +{{! Move to template code after fixing this issue: +https://github.com/google/mdbook-i18n-helpers/issues/70 }} + \ No newline at end of file diff --git a/theme/index.hbs b/theme/index.hbs index dd83020b..30c42d99 100644 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -1,58 +1,63 @@ - - - - - {{ 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}} - - + + + + + + {{ 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}} + + + +
+ + + + +
{{> header}} -