Skip to content

Commit 28a40ee

Browse files
gabydddanillos
authored andcommitted
update with new mdbook index.hbs (helix-editor#8445)
1 parent 22f5df1 commit 28a40ee

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

book/theme/index.hbs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE HTML>
2-
<html lang="{{ language }}" class="sidebar-visible no-js {{ default_theme }}">
2+
<html lang="{{ language }}" class="{{ default_theme }}" dir="{{ text_direction }}">
33
<head>
44
<!-- Book generated using mdBook -->
55
<meta charset="UTF-8">
66
<title>{{ title }}</title>
77
{{#if is_print }}
8-
<meta name="robots" content="noindex" />
8+
<meta name="robots" content="noindex">
99
{{/if}}
1010
{{#if base_url}}
1111
<base href="{{ base_url }}">
@@ -17,7 +17,7 @@
1717

1818
<meta name="description" content="{{ description }}">
1919
<meta name="viewport" content="width=device-width, initial-scale=1">
20-
<meta name="theme-color" content="#ffffff" />
20+
<meta name="theme-color" content="#ffffff">
2121

2222
{{#if favicon_svg}}
2323
<link rel="icon" href="{{ path_to_root }}favicon.svg">
@@ -34,8 +34,6 @@
3434

3535
<!-- Fonts -->
3636
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
37-
<link rel="preconnect" href="https://fonts.gstatic.com">
38-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;700&display=swap" rel="stylesheet">
3937
{{#if copy_fonts}}
4038
<link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
4139
{{/if}}
@@ -55,7 +53,7 @@
5553
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
5654
{{/if}}
5755
</head>
58-
<body>
56+
<body class="sidebar-visible no-js">
5957
<div id="body-container">
6058
<!-- Provide site root to javascript -->
6159
<script>
@@ -85,24 +83,29 @@
8583
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
8684
if (theme === null || theme === undefined) { theme = default_theme; }
8785
var html = document.querySelector('html');
88-
html.classList.remove('no-js')
8986
html.classList.remove('{{ default_theme }}')
9087
html.classList.add(theme);
91-
html.classList.add('js');
88+
var body = document.querySelector('body');
89+
body.classList.remove('no-js')
90+
body.classList.add('js');
9291
</script>
9392

93+
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
94+
9495
<!-- Hide / unhide sidebar before it is displayed -->
9596
<script>
96-
var html = document.querySelector('html');
97+
var body = document.querySelector('body');
9798
var sidebar = null;
99+
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
98100
if (document.body.clientWidth >= 1080) {
99101
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
100102
sidebar = sidebar || 'visible';
101103
} else {
102104
sidebar = 'hidden';
103105
}
104-
html.classList.remove('sidebar-visible');
105-
html.classList.add("sidebar-" + sidebar);
106+
sidebar_toggle.checked = sidebar === 'visible';
107+
body.classList.remove('sidebar-visible');
108+
body.classList.add("sidebar-" + sidebar);
106109
</script>
107110

108111
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
@@ -141,9 +144,9 @@
141144
<div id="menu-bar-hover-placeholder"></div>
142145
<div id="menu-bar" class="menu-bar sticky">
143146
<div class="left-buttons">
144-
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
147+
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
145148
<i class="fa fa-bars"></i>
146-
</button>
149+
</label>
147150
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
148151
<i class="fa fa-paint-brush"></i>
149152
</button>
@@ -220,7 +223,7 @@
220223
{{/previous}}
221224

222225
{{#next}}
223-
<a rel="next" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
226+
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
224227
<i class="fa fa-angle-right"></i>
225228
</a>
226229
{{/next}}
@@ -238,7 +241,7 @@
238241
{{/previous}}
239242

240243
{{#next}}
241-
<a rel="next" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
244+
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
242245
<i class="fa fa-angle-right"></i>
243246
</a>
244247
{{/next}}

0 commit comments

Comments
 (0)