Skip to content

Commit af171d3

Browse files
committed
Add missing docs script
1 parent 0225a49 commit af171d3

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

docs/app/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,31 @@
1111
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
1212
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/docs.css">
1313

14+
<!-- Start Single Page Apps for GitHub Pages -->
15+
<script type="text/javascript">
16+
// Single Page Apps for GitHub Pages
17+
// MIT License
18+
// https://github.com/rafgraph/spa-github-pages
19+
// This script checks to see if a redirect is present in the query string,
20+
// converts it back into the correct url and adds it to the
21+
// browser's history using window.history.replaceState(...),
22+
// which won't cause the browser to attempt to load the new url.
23+
// When the single page app is loaded further down in this file,
24+
// the correct url will be waiting in the browser's history for
25+
// the single page app to route accordingly.
26+
(function(l) {
27+
if (l.search[1] === '/' ) {
28+
var decoded = l.search.slice(1).split('&').map(function(s) {
29+
return s.replace(/~and~/g, '&')
30+
}).join('?');
31+
window.history.replaceState(null, null,
32+
l.pathname.slice(0, -1) + decoded + l.hash
33+
);
34+
}
35+
}(window.location))
36+
</script>
37+
<!-- End Single Page Apps for GitHub Pages -->
38+
1439
{{content-for "head-footer"}}
1540
</head>
1641
<body>

0 commit comments

Comments
 (0)