From 2f2ffc00257e914933af3b0fd04de89d6da7f7d8 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Mon, 13 Jun 2022 15:31:19 +0000
Subject: [PATCH] update search function
---
layouts/partials/search.html | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/layouts/partials/search.html b/layouts/partials/search.html
index bcc56d2..0890675 100644
--- a/layouts/partials/search.html
+++ b/layouts/partials/search.html
@@ -3,7 +3,12 @@
<label for="find" class="search_label">
{{- partial "sprite" (dict "icon" "search") }}
</label>
- <input type="search" class="search_field" placeholder='{{ T "search_field_placeholder" }}' id="find" autocomplete="off">
+ {{ $placeholder := T "search_field_placeholder" (dict "section" .Section) }}
+ {{ if .Section }}
+ {{ else }}
+ {{ $placeholder = printf "%s%s" $placeholder (T "site") }}
+ {{ end }}
+ <input type="search" class="search_field" placeholder='{{ $placeholder }}' id="find" autocomplete="off" data-scope='{{ .Section }}'>
{{- if ne .Params.searchPage true }}
<div class="search_results results"></div>
{{- end }}
--
Gitblit v1.10.0