-
Hi! I am trying to create a second docs page, e.g. called My problem has now become that the search does not return any results. There are no suggestions showing up while I type and when I hit enter it just reloads the page. So far I have not found the reason for this. Can anyone help me fix it? I have published the source code here: https://github.com/xbufu/wiki.git and published them here: https://wiki.bufu-sec.com/ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
For a similar setup, see: #395 Also, make sure to update {{ if and (.Site.Params.options.flexSearch) (site.RegularPages "Type" "in" site.Params.mainSections) -}} |
Beta Was this translation helpful? Give feedback.
-
For those interested a working modification (at least for me) using the above examples is as follows: Index: layouts/partials/footer/script-footer.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/layouts/partials/footer/script-footer.html b/layouts/partials/footer/script-footer.html
--- a/layouts/partials/footer/script-footer.html (revision f5d1bae87c4fba564bcfea69bf6cdbf14332f8ea)
+++ b/layouts/partials/footer/script-footer.html (date 1638266546293)
@@ -74,7 +74,7 @@
{{ with .Params.mermaid -}}
<script src="{{ $mermaid.RelPermalink }}" defer></script>
{{ end -}}
- {{ if and (.Site.Params.options.flexSearch) (eq .Section "docs") -}}
+ {{ if and (.Site.Params.options.flexSearch) (in site.Params.mainSections .Section) -}}
<script src="{{ $index.RelPermalink }}" defer></script>
{{ end -}}
{{ else -}}
@@ -99,7 +99,7 @@
{{ with .Params.mermaid -}}
<script src="{{ $mermaid.RelPermalink }}" integrity="{{ $mermaid.Data.Integrity }}" crossorigin="anonymous" defer></script>
{{ end -}}
- {{ if and (.Site.Params.options.flexSearch) (eq .Section "docs") -}}
+ {{ if and (.Site.Params.options.flexSearch) (in site.Params.mainSections .Section) -}}
<script src="{{ $index.Permalink }}" integrity="{{ $index.Data.Integrity }}" crossorigin="anonymous" defer></script>
{{ end -}}
-{{ end -}}
\ No newline at end of file
+{{ end -}}
Index: layouts/partials/header/header.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html
--- a/layouts/partials/header/header.html (revision f5d1bae87c4fba564bcfea69bf6cdbf14332f8ea)
+++ b/layouts/partials/header/header.html (date 1638266785900)
@@ -93,7 +93,7 @@
</div>
{{ end -}}
-{{ if eq .Section "docs" -}}
+{{ if in site.Params.mainSections .Section -}}
<nav class="doks-subnavbar py-2 sticky-lg-top{{ if eq .Site.Params.options.flexSearch false }} d-lg-none{{ end }}" aria-label="Secondary navigation">
<div class="container-xxl d-flex align-items-md-center">
Index: assets/js/index.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/assets/js/index.js b/assets/js/index.js
--- a/assets/js/index.js (revision f5d1bae87c4fba564bcfea69bf6cdbf14332f8ea)
+++ b/assets/js/index.js (date 1638266164341)
@@ -94,7 +94,7 @@
// https://discourse.gohugo.io/t/range-length-or-last-element/3803/2
- {{ $list := (where .Site.Pages "Section" "docs") -}}
+ {{ $list := (where .Site.Pages "Section" "configuration") -}}
{{ $len := (len $list) -}}
index.add( |
Beta Was this translation helpful? Give feedback.
For a similar setup, see: #395
Also, make sure to update
./layouts/partials/footer/script-footer.html
(lines 77 +102), make it something like (not tested):