add search

This commit is contained in:
geekifan
2025-04-26 17:30:22 +08:00
parent 572efb9a12
commit 78bececd7d
4 changed files with 218 additions and 0 deletions

View File

@ -38,6 +38,7 @@
{{ partialCached "footer.html" . }}
</div>
</div>
{{ partial "search-results.html" . }}
</div>
<aside aria-label="Scroll to Top">

View File

@ -6,6 +6,7 @@
-}}
{{- $themeOpts := merge $jsOpts (dict "global" "Theme") -}}
{{- $theme := resources.Get "js/modules/theme.js" | js.Build $themeOpts -}}
{{- $search := resources.Get "js/search.js" | js.Build $jsOpts -}}
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
@ -74,6 +75,7 @@
<!-- Scripts -->
<script src="{{ $theme.RelPermalink }}"></script>
<script defer src="{{ $search.RelPermalink }}"></script>
{{ partial "js-selector.html" . }}

View File

@ -0,0 +1,8 @@
<div id="search-result-wrapper" class="d-flex justify-content-center d-none">
<div class="col-11 content">
<div id="search-hints">
{{ partial "trending-tags.html" . }}
</div>
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
</div>
</div>