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:
17
README.md
17
README.md
@@ -10,15 +10,14 @@
|
||||
|
||||
### Variables
|
||||
|
||||
| Variable | Value | Description |
|
||||
| ----------------------- | ------------------------ | ----------- |
|
||||
| `params.showDescriptioninHome` | `true` | |
|
||||
| `params.hideAllTagsinHome` | `true` | |
|
||||
| `params.searchBoxPlaceholder` | `Type here to search...` | |
|
||||
| `params.titleIcon` | `index.png` | |
|
||||
| `params.headers.key` | `Title` | |
|
||||
| `params.headers.value` | `Tags` | |
|
||||
| `permalinks.tags` | `@:slug` | |
|
||||
| Variable | Value | Description |
|
||||
| ------------------------------ | ----------- | ----------- |
|
||||
| `params.showDescriptioninHome` | `true` | |
|
||||
| `params.hideAllTagsinHome` | `true` | |
|
||||
| `params.titleIcon` | `index.png` | |
|
||||
| `params.headers.key` | `Title` | |
|
||||
| `params.headers.value` | `Tags` | |
|
||||
| `permalinks.tags` | `@:slug` | |
|
||||
|
||||
### Powered by
|
||||
|
||||
|
@@ -1,3 +1,10 @@
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user