mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 14:31:25 -04:00
feat: revamp search experience
chore: hide toc on small screen chore: make sidebar responsive
This commit is contained in:
@ -2,18 +2,13 @@
|
||||
{{- $pages = where $pages "Params.excludeSearch" "!=" true -}}
|
||||
{{- $pages = where $pages "Content" "!=" "" -}}
|
||||
|
||||
[
|
||||
{{ range $index, $page := $pages }}
|
||||
{{ $pageTitle := $page.LinkTitle | default $page.File.BaseFileName }}
|
||||
{{ $pageContent := $page.Plain }}
|
||||
{{ $pageSection := $page.Parent.LinkTitle }}
|
||||
{{- $output := dict -}}
|
||||
|
||||
{{ if gt $index 0}},{{end}} {
|
||||
"id": {{ $index }},
|
||||
"href": "{{ $page.Permalink }}",
|
||||
"title": {{ $pageTitle | jsonify }},
|
||||
"section": {{ $pageSection | jsonify }},
|
||||
"content": {{ $page.Plain | jsonify }}
|
||||
}
|
||||
{{- end -}}
|
||||
]
|
||||
{{- range $index, $page := $pages -}}
|
||||
{{- $pageTitle := $page.LinkTitle | default $page.File.BaseFileName -}}
|
||||
{{- $pageLink := $page.RelPermalink -}}
|
||||
{{- $data := partial "utils/fragments" $page -}}
|
||||
{{- $output = $output | merge (dict $pageLink (dict "title" $pageTitle "data" $data)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $output | jsonify -}}
|
||||
|
Reference in New Issue
Block a user