Skip to content

Commit bbea489

Browse files
avivaceAntonio Vivace
authored andcommitted
Eject index template from default theme
1 parent b556b65 commit bbea489

File tree

1 file changed

+312
-0
lines changed

1 file changed

+312
-0
lines changed

theme/index.hbs

Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,312 @@
1+
<!DOCTYPE HTML>
2+
<html lang="{{ language }}" class="sidebar-visible no-js {{ default_theme }}">
3+
<head>
4+
<!-- Book generated using mdBook -->
5+
<meta charset="UTF-8">
6+
<title>{{ title }}</title>
7+
{{#if is_print }}
8+
<meta name="robots" content="noindex" />
9+
{{/if}}
10+
{{#if base_url}}
11+
<base href="{{ base_url }}">
12+
{{/if}}
13+
14+
15+
<!-- Custom HTML head -->
16+
{{> head}}
17+
18+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
19+
<meta name="description" content="{{ description }}">
20+
<meta name="viewport" content="width=device-width, initial-scale=1">
21+
<meta name="theme-color" content="#ffffff" />
22+
23+
{{#if favicon_svg}}
24+
<link rel="icon" href="{{ path_to_root }}favicon.svg">
25+
{{/if}}
26+
{{#if favicon_png}}
27+
<link rel="shortcut icon" href="{{ path_to_root }}favicon.png">
28+
{{/if}}
29+
<link rel="stylesheet" href="{{ path_to_root }}css/variables.css">
30+
<link rel="stylesheet" href="{{ path_to_root }}css/general.css">
31+
<link rel="stylesheet" href="{{ path_to_root }}css/chrome.css">
32+
{{#if print_enable}}
33+
<link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
34+
{{/if}}
35+
36+
<!-- Fonts -->
37+
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
38+
{{#if copy_fonts}}
39+
<link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
40+
{{/if}}
41+
42+
<!-- Highlight.js Stylesheets -->
43+
<link rel="stylesheet" href="{{ path_to_root }}highlight.css">
44+
<link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css">
45+
<link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css">
46+
47+
<!-- Custom theme stylesheets -->
48+
{{#each additional_css}}
49+
<link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
50+
{{/each}}
51+
52+
{{#if mathjax_support}}
53+
<!-- MathJax -->
54+
<script async type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
55+
{{/if}}
56+
</head>
57+
<body>
58+
<!-- Provide site root to javascript -->
59+
<script type="text/javascript">
60+
var path_to_root = "{{ path_to_root }}";
61+
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
62+
</script>
63+
64+
<!-- Work around some values being stored in localStorage wrapped in quotes -->
65+
<script type="text/javascript">
66+
try {
67+
var theme = localStorage.getItem('mdbook-theme');
68+
var sidebar = localStorage.getItem('mdbook-sidebar');
69+
70+
if (theme.startsWith('"') && theme.endsWith('"')) {
71+
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
72+
}
73+
74+
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
75+
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
76+
}
77+
} catch (e) { }
78+
</script>
79+
80+
<!-- Set the theme before any content is loaded, prevents flash -->
81+
<script type="text/javascript">
82+
var theme;
83+
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
84+
if (theme === null || theme === undefined) { theme = default_theme; }
85+
var html = document.querySelector('html');
86+
html.classList.remove('no-js')
87+
html.classList.remove('{{ default_theme }}')
88+
html.classList.add(theme);
89+
html.classList.add('js');
90+
</script>
91+
92+
<!-- Hide / unhide sidebar before it is displayed -->
93+
<script type="text/javascript">
94+
var html = document.querySelector('html');
95+
var sidebar = 'hidden';
96+
if (document.body.clientWidth >= 1080) {
97+
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
98+
sidebar = sidebar || 'visible';
99+
}
100+
html.classList.remove('sidebar-visible');
101+
html.classList.add("sidebar-" + sidebar);
102+
</script>
103+
104+
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
105+
<div class="sidebar-scrollbox">
106+
{{#toc}}{{/toc}}
107+
</div>
108+
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
109+
</nav>
110+
111+
<div id="page-wrapper" class="page-wrapper">
112+
113+
<div class="page">
114+
{{> header}}
115+
<div id="menu-bar-hover-placeholder"></div>
116+
<div id="menu-bar" class="menu-bar sticky bordered">
117+
<div class="left-buttons">
118+
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
119+
<i class="fa fa-bars"></i>
120+
</button>
121+
<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">
122+
<i class="fa fa-paint-brush"></i>
123+
</button>
124+
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
125+
<li role="none"><button role="menuitem" class="theme" id="light">{{ theme_option "Light" }}</button></li>
126+
<li role="none"><button role="menuitem" class="theme" id="rust">{{ theme_option "Rust" }}</button></li>
127+
<li role="none"><button role="menuitem" class="theme" id="coal">{{ theme_option "Coal" }}</button></li>
128+
<li role="none"><button role="menuitem" class="theme" id="navy">{{ theme_option "Navy" }}</button></li>
129+
<li role="none"><button role="menuitem" class="theme" id="ayu">{{ theme_option "Ayu" }}</button></li>
130+
</ul>
131+
{{#if search_enabled}}
132+
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
133+
<i class="fa fa-search"></i>
134+
</button>
135+
{{/if}}
136+
</div>
137+
138+
<h1 class="menu-title">{{ book_title }}</h1>
139+
140+
<div class="right-buttons">
141+
{{#if print_enable}}
142+
<a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
143+
<i id="print-button" class="fa fa-print"></i>
144+
</a>
145+
{{/if}}
146+
{{#if git_repository_url}}
147+
<a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
148+
<i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
149+
</a>
150+
{{/if}}
151+
{{#if git_repository_edit_url}}
152+
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
153+
<i id="git-edit-button" class="fa fa-edit"></i>
154+
</a>
155+
{{/if}}
156+
157+
</div>
158+
</div>
159+
160+
{{#if search_enabled}}
161+
<div id="search-wrapper" class="hidden">
162+
<form id="searchbar-outer" class="searchbar-outer">
163+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
164+
</form>
165+
<div id="searchresults-outer" class="searchresults-outer hidden">
166+
<div id="searchresults-header" class="searchresults-header"></div>
167+
<ul id="searchresults">
168+
</ul>
169+
</div>
170+
</div>
171+
{{/if}}
172+
173+
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
174+
<script type="text/javascript">
175+
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
176+
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
177+
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
178+
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
179+
});
180+
</script>
181+
182+
<div id="content" class="content">
183+
<main>
184+
{{{ content }}}
185+
</main>
186+
187+
<nav class="nav-wrapper" aria-label="Page navigation">
188+
<!-- Mobile navigation buttons -->
189+
{{#previous}}
190+
<a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
191+
<i class="fa fa-angle-left"></i>
192+
</a>
193+
{{/previous}}
194+
195+
{{#next}}
196+
<a rel="next" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
197+
<i class="fa fa-angle-right"></i>
198+
</a>
199+
{{/next}}
200+
201+
<div style="clear: both"></div>
202+
</nav>
203+
</div>
204+
</div>
205+
206+
<nav class="nav-wide-wrapper" aria-label="Page navigation">
207+
{{#previous}}
208+
<a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
209+
<i class="fa fa-angle-left"></i>
210+
</a>
211+
{{/previous}}
212+
213+
{{#next}}
214+
<a rel="next" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
215+
<i class="fa fa-angle-right"></i>
216+
</a>
217+
{{/next}}
218+
</nav>
219+
220+
</div>
221+
222+
{{#if livereload}}
223+
<!-- Livereload script (if served using the cli tool) -->
224+
<script type="text/javascript">
225+
var socket = new WebSocket("{{{livereload}}}");
226+
socket.onmessage = function (event) {
227+
if (event.data === "reload") {
228+
socket.close();
229+
location.reload();
230+
}
231+
};
232+
233+
window.onbeforeunload = function() {
234+
socket.close();
235+
}
236+
</script>
237+
{{/if}}
238+
239+
{{#if google_analytics}}
240+
<!-- Google Analytics Tag -->
241+
<script type="text/javascript">
242+
var localAddrs = ["localhost", "127.0.0.1", ""];
243+
244+
// make sure we don't activate google analytics if the developer is
245+
// inspecting the book locally...
246+
if (localAddrs.indexOf(document.location.hostname) === -1) {
247+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
248+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
249+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
250+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
251+
252+
ga('create', '{{google_analytics}}', 'auto');
253+
ga('send', 'pageview');
254+
}
255+
</script>
256+
{{/if}}
257+
258+
{{#if playground_line_numbers}}
259+
<script type="text/javascript">
260+
window.playground_line_numbers = true;
261+
</script>
262+
{{/if}}
263+
264+
{{#if playground_copyable}}
265+
<script type="text/javascript">
266+
window.playground_copyable = true;
267+
</script>
268+
{{/if}}
269+
270+
{{#if playground_js}}
271+
<script src="{{ path_to_root }}ace.js" type="text/javascript" charset="utf-8"></script>
272+
<script src="{{ path_to_root }}editor.js" type="text/javascript" charset="utf-8"></script>
273+
<script src="{{ path_to_root }}mode-rust.js" type="text/javascript" charset="utf-8"></script>
274+
<script src="{{ path_to_root }}theme-dawn.js" type="text/javascript" charset="utf-8"></script>
275+
<script src="{{ path_to_root }}theme-tomorrow_night.js" type="text/javascript" charset="utf-8"></script>
276+
{{/if}}
277+
278+
{{#if search_js}}
279+
<script src="{{ path_to_root }}elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
280+
<script src="{{ path_to_root }}mark.min.js" type="text/javascript" charset="utf-8"></script>
281+
<script src="{{ path_to_root }}searcher.js" type="text/javascript" charset="utf-8"></script>
282+
{{/if}}
283+
284+
<script src="{{ path_to_root }}clipboard.min.js" type="text/javascript" charset="utf-8"></script>
285+
<script src="{{ path_to_root }}highlight.js" type="text/javascript" charset="utf-8"></script>
286+
<script src="{{ path_to_root }}book.js" type="text/javascript" charset="utf-8"></script>
287+
288+
<!-- Custom JS scripts -->
289+
{{#each additional_js}}
290+
<script type="text/javascript" src="{{ ../path_to_root }}{{this}}"></script>
291+
{{/each}}
292+
293+
{{#if is_print}}
294+
{{#if mathjax_support}}
295+
<script type="text/javascript">
296+
window.addEventListener('load', function() {
297+
MathJax.Hub.Register.StartupHook('End', function() {
298+
window.setTimeout(window.print, 100);
299+
});
300+
});
301+
</script>
302+
{{else}}
303+
<script type="text/javascript">
304+
window.addEventListener('load', function() {
305+
window.setTimeout(window.print, 100);
306+
});
307+
</script>
308+
{{/if}}
309+
{{/if}}
310+
311+
</body>
312+
</html>

0 commit comments

Comments
 (0)