From bb97d9d473467da594d859a5f55ad63d2b7ac36e Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 31 Mar 2025 20:25:55 +0800 Subject: feat: global search press command/ctrl + k anywhere to search the site Former-commit-id: 87617f9e21540c8075b99238c5b3461d89765acc --- layouts/_default/baseof.html | 1 + layouts/partials/components/global-search.html | 109 +++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 layouts/partials/components/global-search.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index ebbb6ec7..5898e418 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -6,6 +6,7 @@ {{ block "main" . }}{{ end }} {{ partial "scripts.html" . }} + {{ partial "components/global-search" . }} {{ if .Site.Params.extraBody }} {{ .Site.Params.extraBody | safeHTML }} {{ end }} diff --git a/layouts/partials/components/global-search.html b/layouts/partials/components/global-search.html new file mode 100644 index 00000000..c12a6d79 --- /dev/null +++ b/layouts/partials/components/global-search.html @@ -0,0 +1,109 @@ + +
+ + + + -- cgit v1.2.3