-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(theme): Fix side menu being stuck open and obscuring most of the …
…page (#376)
- Loading branch information
Showing
5 changed files
with
930 additions
and
783 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,11 @@ | |
right: 10px; | ||
} | ||
|
||
[dir="rtl"] #language-list { | ||
left: 10px; | ||
right: auto; | ||
} | ||
|
||
#language-list a { | ||
color: inherit; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{! Move to template code after fixing this issue: | ||
https://github.com/google/mdbook-i18n-helpers/issues/70 }} | ||
<script> | ||
(function () { | ||
// See these pages for details: | ||
// https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls | ||
// https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics | ||
let base = "https://rust-unofficial.github.io/patterns"; | ||
{{#if(eq language "en")}} | ||
let canonical_href = `${base}/{{ path }}`; | ||
{{else}} | ||
let canonical_href = `${base}/{{ language }}/{{ path }}`; | ||
{{/if}} | ||
// mdbook gives us a string ending in ".md", we replace it with ".html": | ||
canonical_href = canonical_href.slice(0, -"md".length) + "html"; | ||
if (canonical_href.endsWith("/index.html")) { | ||
canonical_href = canonical_href.slice(0, -"index.html".length); | ||
} | ||
let link = document.createElement("link"); | ||
link.rel = "canonical"; | ||
link.href = canonical_href; | ||
document.head.appendChild(link); | ||
}) () | ||
</script> |
Oops, something went wrong.