mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
23 lines
No EOL
1.6 KiB
HTML
23 lines
No EOL
1.6 KiB
HTML
<div class="searchbox default-animation">
|
|
<label for="search-by"><i class="fas fa-search"></i></label>
|
|
<input data-search-input id="search-by" type="search" placeholder="{{ T "Search-placeholder" }}">
|
|
<span data-search-clear=""><i class="fas fa-times"></i></span>
|
|
</div>
|
|
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
|
|
{{- $pageBaseLang := replaceRE "([a-z]+).*" "${1}" .Page.Lang }}
|
|
{{- $contentlangs := (union (slice | append .Site.Params.contentLang) (slice $pageBaseLang)) }}
|
|
{{- $quotedcontentlangs := slice }}
|
|
{{- range $contentlangs }}
|
|
{{- $quotedcontentlangs = $quotedcontentlangs | append (printf "'%s'" .) }}
|
|
{{- end }}
|
|
<script>
|
|
var contentLangs=[{{ delimit $quotedcontentlangs ", " | safeJS }}];
|
|
</script>
|
|
<script src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
|
<script src="{{"js/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
|
<script src="{{"js/lunr.stemmer.support.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
|
<script src="{{"js/lunr.multi.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
|
{{- range $contentlangs }}
|
|
<script src="{{ (printf "js/lunr.%s.min.js" .) | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
|
|
{{- end }}
|
|
<script src="{{ "js/search.js" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script> |