1
0
mirror of https://github.com/snachodog/just-the-docs.git synced 2025-04-07 04:31:21 -06:00

feat: adds search placeholder configuration ()

* implements search placeholder configuration

* changes implementation approach to use search_placeholder_custom

Thanks to @pdmosses for the suggestion!

* strips whitespace and HTML for both placeholder and aria-label
This commit is contained in:
Matt Wang 2022-07-04 12:25:21 -07:00 committed by GitHub
parent 312f1bceac
commit c980fd4a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

@ -0,0 +1 @@
Search {{site.title}}

@ -92,9 +92,12 @@ layout: table_wrappers
<div class="main" id="top">
<div id="main-header" class="main-header">
{% if site.search_enabled != false %}
{% capture search_placeholder %}{% include search_placeholder_custom.html %}{% endcapture %}
<div class="search">
<div class="search-input-wrap">
<input type="text" id="search-input" class="search-input" tabindex="0" placeholder="Search {{ site.title }}" aria-label="Search {{ site.title }}" autocomplete="off">
<input type="text" id="search-input" class="search-input" tabindex="0" placeholder="{{ search_placeholder | strip_html | strip }}" aria-label="{{ search_placeholder | strip_html| strip }}" autocomplete="off">
<label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon"><use xlink:href="#svg-search"></use></svg></label>
</div>
<div id="search-results" class="search-results"></div>