feat: basic flexsearch implementation

This commit is contained in:
Xin
2023-08-04 01:11:31 +01:00
parent b90c2e7737
commit 16a656947b
7 changed files with 139 additions and 6 deletions

View File

@ -3,17 +3,19 @@
<nav class="mx-auto flex items-center justify-end gap-2 h-16 px-6 max-w-[90rem]">
<a class="flex items-center hover:opacity-75 ltr:mr-auto rtl:ml-auto" href="{{ .Site.BaseURL }}">
{{ partial "utils/icon.html" (dict "context" . "name" "hugo" "attributes" "height=20") }}
{{ partial "utils/icon.html" (dict "name" "hugo" "attributes" "height=20") }}
<span class="mx-2 font-extrabold hidden md:inline select-none" title="{{ .Site.Title }}">
{{ .Site.Title }}
</span>
</a>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ if .Params.icon }}
{{- $currentPage := . -}}
{{- range .Site.Menus.main -}}
{{- if eq .Name "Search" -}}
{{ partial "search.html" (dict "params" .Params) }}
{{- else if .Params.icon -}}
<a class="p-2 text-current" target="_blank" rel="noreferer" href="{{ .URL }}">
{{ partial "utils/icon.html" (dict "context" $currentPage "name" .Params.icon "attributes" "height=24") }}
{{ partial "utils/icon.html" (dict "name" .Params.icon "attributes" "height=24") }}
<span class="sr-only">{{ .Name }}</span>
</a>
{{ else }}