Skip to content

Commit 95cc91d

Browse files
committed
fix: search json
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
1 parent fa566fe commit 95cc91d

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

docs/layouts/partials/head.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@
3939
</script>
4040
<script type="text/javascript" src="{{ "js/script.js" | relURL }}"></script>
4141
<script type="text/javascript" src="{{ "js/lunr.min.js" | relURL}}"></script>
42-
<script type="text/javascript">
43-
var baseurl = "{{.Site.BaseURL}}";
42+
<a id="indexJSON" href="{{ "./index.json" | relURL}}"></a>
4443

45-
</script>
4644
<script type="text/javascript" src="{{ "js/auto-complete.js" | relURL}}"></script>
4745
<script type="text/javascript" src="{{ "js/search.js" | relURL}}"></script>
4846
<script type="text/javascript" src="{{ "js/asciinema-player.js" | relURL}}"></script>

docs/static/js/search.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ function endsWith(str, suffix) {
77

88
// Initialize lunrjs using our generated index file
99
function initLunr() {
10-
if (!endsWith(baseurl,"/")){
11-
baseurl = baseurl+'/'
12-
};
13-
1410
// First retrieve the index file
15-
$.getJSON(baseurl +"index.json")
11+
$.getJSON($('#indexJSON').attr('href'))
1612
.done(function(index) {
1713
pagesIndex = index;
1814
// Set up lunrjs by declaring the fields we use
@@ -74,9 +70,6 @@ $( document ).ready(function() {
7470
item.context = text;
7571

7672
var pathItem = item.uri;
77-
if (pathItem.startsWith(baseurl)) {
78-
pathItem = pathItem.slice(baseurl.length);
79-
}
8073
if (endsWith(pathItem,"/")) {
8174
pathItem = pathItem.substring(0, pathItem.length-1);
8275
};

ui/src/app/views/navbar/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
<a sm-item href="#" [routerLink]="['settings', 'queue']">{{ 'admin_queue_title' | translate }}</a>
310310
<div class="divider"></div>
311311
<a sm-item href="#" [routerLink]="['settings', 'downloads']">{{ 'navbar_downloads' | translate }}</a>
312-
<a sm-item href="/docs" target="_blank" rel="noopener noreferrer">{{ 'navbar_documentation' | translate }}</a>
312+
<a sm-item href="#" [routerLink]="['docs', '']" target="_blank" rel="noopener noreferrer">{{ 'navbar_documentation' | translate }}</a>
313313
<div class="divider"></div>
314314
<sm-checkbox class="theme-switch" name="switch-theme" [control]="themeSwitch" type="toggle"
315315
label="{{'navbar_dark_mode' | translate}}" (change)="changeTheme()"></sm-checkbox>

0 commit comments

Comments
 (0)