mirror of
https://github.com/adityatelange/hugo-index.git
synced 2025-10-07 01:54:17 +00:00
Add search placeholder by calc pages and tags
ex. Search among X titles and Y tags. Removes param searchBoxPlaceholder
This commit is contained in:
@@ -11,10 +11,9 @@
|
|||||||
### Variables
|
### Variables
|
||||||
|
|
||||||
| Variable | Value | Description |
|
| Variable | Value | Description |
|
||||||
| ----------------------- | ------------------------ | ----------- |
|
| ------------------------------ | ----------- | ----------- |
|
||||||
| `params.showDescriptioninHome` | `true` | |
|
| `params.showDescriptioninHome` | `true` | |
|
||||||
| `params.hideAllTagsinHome` | `true` | |
|
| `params.hideAllTagsinHome` | `true` | |
|
||||||
| `params.searchBoxPlaceholder` | `Type here to search...` | |
|
|
||||||
| `params.titleIcon` | `index.png` | |
|
| `params.titleIcon` | `index.png` | |
|
||||||
| `params.headers.key` | `Title` | |
|
| `params.headers.key` | `Title` | |
|
||||||
| `params.headers.value` | `Tags` | |
|
| `params.headers.value` | `Tags` | |
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
<div class="searchBox">
|
<div class="searchBox">
|
||||||
<input id="search" autofocus type="search" placeholder='{{ site.Params.searchBoxPlaceholder | default "Search ..." }}' autocomplete="off" />
|
<input id="search" autofocus type="search" placeholder='
|
||||||
|
{{- with site.Params.headers }}
|
||||||
|
{{- print "Search among" }}
|
||||||
|
{{- printf " %d %s " (len site.RegularPages) (.key | pluralize | lower) }}
|
||||||
|
{{- print "and" }}
|
||||||
|
{{- printf " %d %s..." (len site.Taxonomies.tags) (.value | pluralize | lower) }}
|
||||||
|
{{- end -}}
|
||||||
|
' autocomplete="off" />
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user