mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
feat(search): add pagefind search engine support (#738)
* feat(search): add native pagefind support * chore: code review and change --------- Co-authored-by: Cell <1024@lruihao.cn>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{{- if and .Site.Params.search.enable (eq .Site.Params.search.type "pagefind") .IsPage -}}
|
||||
{{- $params := partial "function/params.html" -}}
|
||||
{{- $hidden := cond (eq $params.hiddenFromSearch true) "true" "false" -}}
|
||||
{{- $encrypted := cond (and (isset $params "password") (ne (printf "%v" $params.password) "")) "true" "false" -}}
|
||||
{{- $pageDate := (.PublishDate | default .Date) -}}
|
||||
{{- $dateLabel := $pageDate | dateFormat (.Site.Params.dateFormat | default "2006-01-02") -}}
|
||||
<meta data-pagefind-filter="hidden:{{ $hidden }}">
|
||||
<meta data-pagefind-filter="encrypted:{{ $encrypted }}">
|
||||
<meta data-pagefind-meta="date:{{ $dateLabel }}">
|
||||
<meta data-pagefind-sort="date:{{ $pageDate.Unix }}">
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user