Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Search icon in masthead is a Font Awesome icon. #2774

Merged
merged 3 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ atom_feed:
search : # true, false (default)
search_full_content : # true, false (default)
search_provider : # lunr (default), algolia, google
search_icon : # builtin (default), Font Awesome class combination ("fas fa-search" recommended)
algolia:
application_id : # YOUR_APPLICATION_ID
index_name : # YOUR_INDEX_NAME
Expand Down
4 changes: 4 additions & 0 deletions _includes/masthead.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
{% if site.search == true %}
<button class="search__toggle" type="button">
<span class="visually-hidden">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search" }}</span>
{% if site.search_icon and site.search_icon != 'builtin' %}
<i class="{{ site.search_icon }}"></i>
rhwood marked this conversation as resolved.
Show resolved Hide resolved
{% else %}
<svg class="icon" width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.99 16">
<path d="M15.5,13.12L13.19,10.8a1.69,1.69,0,0,0-1.28-.55l-0.06-.06A6.5,6.5,0,0,0,5.77,0,6.5,6.5,0,0,0,2.46,11.59a6.47,6.47,0,0,0,7.74.26l0.05,0.05a1.65,1.65,0,0,0,.5,1.24l2.38,2.38A1.68,1.68,0,0,0,15.5,13.12ZM6.4,2A4.41,4.41,0,1,1,2,6.4,4.43,4.43,0,0,1,6.4,2Z" transform="translate(-.01)"></path>
</svg>
{% endif %}
</button>
{% endif %}
<button class="greedy-nav__toggle hidden" type="button">
Expand Down
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ atom_feed:
search : true # true, false (default)
search_full_content : true # true, false (default)
search_provider : algolia # lunr (default), algolia
search_icon : # builtin (default), Font Awesome class combination ("fas fa-search" recommended)
algolia:
application_id : QB6HVGBSBA # YOUR_APPLICATION_ID
index_name : minimal_mistakes # YOUR_INDEX_NAME
Expand Down
4 changes: 4 additions & 0 deletions docs/_docs/05-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ Add a Google search box to your site.
**Note:** If your site is new and hasn't been indexed by Google yet, search will be incomplete and won't provide accurate results.
{: .notice--info}

#### Search Icon

To change the search icon to a Font Awesome icon, add `search_icon: "fas fa-search"` (or other Font Awesome classes) to your `_config.yml`.

### SEO, social sharing, and analytics settings

All optional, but a good idea to take the time setting up to improve SEO and links shared from the site.
Expand Down