Fix theme text strings for `search_placeholder_text` and `results_found`

Close #104
This commit is contained in:
Michael Rose 2019-08-02 12:10:12 -04:00
parent ce6162faee
commit 8b9af8e812
5 changed files with 8 additions and 3 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Update GitHub issue templates. - Update GitHub issue templates.
### Fixed ### Fixed
- Fix theme text strings for `search_placeholder_text` and `results_found`. [#104](https://github.com/mmistakes/jekyll-theme-basically-basic/issues/104)
- Remove stray `console.log` from lunr-search-scripts [#105](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/105) - Remove stray `console.log` from lunr-search-scripts [#105](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/105)
- Add missing `/` in icon-gitlab.html. [#80](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/80) - Add missing `/` in icon-gitlab.html. [#80](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/80)

View File

@ -351,6 +351,10 @@ t:
skip_content: "Skip to content" skip_content: "Skip to content"
skip_footer: "Skip to footer" skip_footer: "Skip to footer"
menu: "Menu" menu: "Menu"
search: "Search"
site_search: "Site Search"
results_found: "Result(s) found"
search_placeholder_text: "Enter your search term..."
home: "Home" home: "Home"
newer: "Newer" newer: "Newer"
older: "Older" older: "Older"

View File

@ -4,7 +4,7 @@
{%- case search_provider -%} {%- case search_provider -%}
{%- when "lunr" -%} {%- when "lunr" -%}
<label class="visually-hidden" for="search">{{ site.data.theme.t.site_search | default: 'Site Search' }}</label> <label class="visually-hidden" for="search">{{ site.data.theme.t.site_search | default: 'Site Search' }}</label>
<input type="text" id="search" class="search-input" aria-describedby="results-count" tabindex="-1" placeholder="{{ site.data.theme.t.menu.search_placeholder_text | default: 'Enter your search term...' }}" /> <input type="text" id="search" class="search-input" aria-describedby="results-count" tabindex="-1" placeholder="{{ site.data.theme.t.search_placeholder_text | default: 'Enter your search term...' }}" />
<div id="results" class="results"></div> <div id="results" class="results"></div>
{%- when "algolia" -%} {%- when "algolia" -%}
<div tabindex="-1" class="search-searchbar"></div> <div tabindex="-1" class="search-searchbar"></div>

View File

@ -35,7 +35,7 @@ search.addWidget(
instantsearch.widgets.searchBox({ instantsearch.widgets.searchBox({
container: '.search-searchbar', container: '.search-searchbar',
{% unless site.algolia.powered_by == false %}poweredBy: true,{% endunless %} {% unless site.algolia.powered_by == false %}poweredBy: true,{% endunless %}
placeholder: '{{ site.data.theme.t.menu.search_placeholder_text | default: "Enter your search term..." }}' placeholder: '{{ site.data.theme.t.search_placeholder_text | default: "Enter your search term..." }}'
}) })
); );
search.addWidget( search.addWidget(

View File

@ -86,7 +86,7 @@
}) })
}); });
resultdiv.empty(); resultdiv.empty();
resultdiv.prepend('<p id="results-count" class="results-found">' + result.length + ' {{ site.data.theme.t.menu.results_found | default: "Result(s) found" }}</p>'); resultdiv.prepend('<p id="results-count" class="results-found">' + result.length + ' {{ site.data.theme.t.results_found | default: "Result(s) found" }}</p>');
for (var item in result) { for (var item in result) {
var ref = result[item].ref; var ref = result[item].ref;
var searchitem = var searchitem =