mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-05-23 18:24:27 +00:00
search: create search index and page from template and content adapter #888
This commit is contained in:
parent
e1a1f01f4c
commit
d9e69db2f1
18 changed files with 129 additions and 103 deletions
content/_relearn
6
content/_relearn/_index.md
Normal file
6
content/_relearn/_index.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
[_build]
|
||||
render = "never"
|
||||
list = "never"
|
||||
publishResources = false
|
||||
+++
|
16
content/_relearn/searchpage/_content.gotmpl
Normal file
16
content/_relearn/searchpage/_content.gotmpl
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{- if and (not .Site.Params.disableSearchIndex) (not .Site.Params.disableSearchPage) }}
|
||||
{{- .EnableAllLanguages }}
|
||||
{{- $url := trim (or .Site.Params.searchPageURL "search") "/" }}
|
||||
{{- $content := dict
|
||||
"mediaType" "text/markdown"
|
||||
"value" "{{% _relearn_searchform %}}"
|
||||
}}
|
||||
{{- $page := dict
|
||||
"content" $content
|
||||
"kind" "page"
|
||||
"path" "_relearn_searchpage"
|
||||
"title" (T "Search")
|
||||
"url" $url
|
||||
}}
|
||||
{{- .AddPage $page }}
|
||||
{{- end }}
|
6
content/_relearn/searchpage/_index.md
Normal file
6
content/_relearn/searchpage/_index.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
[_build]
|
||||
render = "never"
|
||||
list = "never"
|
||||
publishResources = false
|
||||
+++
|
Loading…
Add table
Add a link
Reference in a new issue