Skip to content

Commit

Permalink
Add search placeholder by calc pages and tags
Browse files Browse the repository at this point in the history
ex. Search among X titles and Y tags.
Removes param searchBoxPlaceholder
  • Loading branch information
adityatelange committed May 21, 2023
1 parent 435a642 commit 030461a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 8 additions & 1 deletion layouts/partials/searchbox.html
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 030461a

Please sign in to comment.