feat: revamp search experience

chore: hide toc on small screen

chore: make sidebar responsive
This commit is contained in:
Xin
2023-08-06 01:06:32 +01:00
parent 16a656947b
commit 7e37b73779
12 changed files with 390 additions and 77 deletions

View File

@ -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 -}}