mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
search: index file rename #888
This commit is contained in:
parent
f8e36bb08c
commit
24726ef4b0
5 changed files with 8 additions and 8 deletions
|
@ -16,4 +16,4 @@
|
||||||
) }}
|
) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
var relearn_search_index = {{ $pages | jsonify (dict "indent" " ") }}
|
var relearn_searchindex = {{ $pages | jsonify (dict "indent" " ") }}
|
|
@ -157,10 +157,10 @@ disableSearch = false
|
||||||
disableSearchIndex = false
|
disableSearchIndex = false
|
||||||
|
|
||||||
# URL of the search index file relative to the language home.
|
# URL of the search index file relative to the language home.
|
||||||
# Default: "search_index.js"
|
# Default: "searchindex.js"
|
||||||
# You have to set this option if your page already has a content file named
|
# You have to set this option if your page already has a content file named
|
||||||
# `search_index.js` in the language home.
|
# `searchindex.js` in the language home.
|
||||||
searchIndexURL = "search_index.js"
|
searchIndexURL = "searchindex.js"
|
||||||
|
|
||||||
# Disable the dedicated search page.
|
# Disable the dedicated search page.
|
||||||
# Default: false
|
# Default: false
|
||||||
|
|
|
@ -73,7 +73,7 @@ By default all three levels are enabled. You can disable each level by the follo
|
||||||
|
|
||||||
By default the following files will be created for each level, relative to each languages home page but can be overwritten:
|
By default the following files will be created for each level, relative to each languages home page but can be overwritten:
|
||||||
|
|
||||||
- search popup: `search_index.js`, configured by `searchIndexURL`
|
- search popup: `searchindex.js`, configured by `searchIndexURL`
|
||||||
- dedicated search page: either `/search.html` or `search/index.html` depending on your settings for `uglyURLs`, configured by `searchPageURL`
|
- dedicated search page: either `/search.html` or `search/index.html` depending on your settings for `uglyURLs`, configured by `searchPageURL`
|
||||||
|
|
||||||
{{% notice note %}}
|
{{% notice note %}}
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
{{- warnf "UNSUPPORTED usage of 'searchpage' output format found, remove it from your config; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#700" }}
|
{{- warnf "UNSUPPORTED usage of 'searchpage' output format found, remove it from your config; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#700" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if not .Site.Params.disableSearchIndex }}
|
{{- if not .Site.Params.disableSearchIndex }}
|
||||||
{{- $url := path.Join .Site.LanguagePrefix (trim (or .Site.Params.searchIndexURL "search_index.js") "/") }}
|
{{- $url := path.Join .Site.LanguagePrefix (trim (or .Site.Params.searchIndexURL "searchindex.js") "/") }}
|
||||||
{{- $templateres := resources.Get "_relearn_search_index.js" }}
|
{{- $templateres := resources.Get "_relearn_searchindex.js" }}
|
||||||
{{- $resultres := $templateres | resources.ExecuteAsTemplate $url .Site.Home }}
|
{{- $resultres := $templateres | resources.ExecuteAsTemplate $url .Site.Home }}
|
||||||
{{- /* the following code causes Hugo to generate our file - although it is in comments */}}<!-- {{ $resultres.RelPermalink }} -->
|
{{- /* the following code causes Hugo to generate our file - although it is in comments */}}<!-- {{ $resultres.RelPermalink }} -->
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -116,7 +116,7 @@ function initLunrJs() {
|
||||||
js.src = index_js_url;
|
js.src = index_js_url;
|
||||||
js.setAttribute("async", "");
|
js.setAttribute("async", "");
|
||||||
js.onload = function(){
|
js.onload = function(){
|
||||||
initLunrIndex(relearn_search_index);
|
initLunrIndex(relearn_searchindex);
|
||||||
};
|
};
|
||||||
js.onerror = function(e){
|
js.onerror = function(e){
|
||||||
console.error('Error getting Hugo index file');
|
console.error('Error getting Hugo index file');
|
||||||
|
|
Loading…
Reference in a new issue