Merge pull request #799 from james-d-elliott/feat-search-sections
feat(search): allow complete section customization
This commit is contained in:
@ -34,9 +34,14 @@
|
||||
{{ $slice = $slice | append $instantPage -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if .Site.Params.options.flexSearch -}}
|
||||
{{ $showFlexSearch := .Site.Params.options.flexSearch }}
|
||||
|
||||
{{ if $showFlexSearch -}}
|
||||
{{ $flexSearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.bundle.js" -}}
|
||||
{{ $slice = $slice | append $flexSearch -}}
|
||||
{{ if and (isset .Site.Params.options "searchsectionsshow") (not (eq .Site.Params.options.searchSectionsShow "ALL")) -}}
|
||||
{{ $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) (and .IsHome (in .Site.Params.options.searchSectionsShow "HomePage")) -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if .Site.Params.options.darkMode -}}
|
||||
@ -83,7 +88,7 @@
|
||||
{{ with .Params.mermaid -}}
|
||||
<script src="{{ $mermaid.RelPermalink }}" defer></script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.options.flexSearch -}}
|
||||
{{ if $showFlexSearch -}}
|
||||
<script src="{{ $index.RelPermalink }}" defer></script>
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
@ -108,7 +113,7 @@
|
||||
{{ with .Params.mermaid -}}
|
||||
<script src="{{ $mermaid.RelPermalink }}" integrity="{{ $mermaid.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.options.flexSearch -}}
|
||||
{{ if $showFlexSearch -}}
|
||||
<script src="{{ $index.Permalink }}" integrity="{{ $index.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
@ -77,7 +77,14 @@
|
||||
{{ end -}}
|
||||
</ul>
|
||||
|
||||
{{ if .Site.Params.options.flexSearch -}}
|
||||
{{- $showFlexSearch := .Site.Params.options.flexSearch }}
|
||||
{{- if $showFlexSearch }}
|
||||
{{- if and (isset .Site.Params.options "searchsectionsshow") (not (eq .Site.Params.options.searchSectionsShow "ALL")) }}
|
||||
{{- $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) (and .IsHome (in .Site.Params.options.searchSectionsShow "HomePage")) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{ if $showFlexSearch -}}
|
||||
<hr class="text-black-50 my-4 d-lg-none">
|
||||
<form class="doks-search position-relative flex-grow-1 ms-lg-auto me-lg-2">
|
||||
<input id="search" class="form-control is-search" type="search" placeholder="Search docs..." aria-label="Search docs..." autocomplete="off">
|
||||
|
Reference in New Issue
Block a user