From 7815e717750210f4887d72c63cdb3a22597ad5fd Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Thu, 7 Dec 2017 08:56:14 -0500 Subject: [PATCH] Feature: Incorporate site search into masthead (#1383) * Integrate search into masthead * Fix cutoff descenders in archive article titles * Remove search page from `/test` site * Enable masthead search * Remove dedicated search page * Fix masthead search form padding * Improve insertion of search content * Speed up page transition * Add fade transition to search content * Rename visibility class names * Add `site.search` to _config.yml * Document site search feature * Update CHANGELOG and history --- CHANGELOG.md | 1 + _config.yml | 1 + _includes/masthead.html | 9 +- _includes/scripts.html | 2 +- _includes/search_form.html | 4 + _layouts/default.html | 10 +- _layouts/search.html | 2 +- _sass/minimal-mistakes/_archive.scss | 32 +- _sass/minimal-mistakes/_base.scss | 66 +- _sass/minimal-mistakes/_masthead.scss | 8 +- _sass/minimal-mistakes/_navigation.scss | 832 +++++++++--------- _sass/minimal-mistakes/_page.scss | 27 +- _sass/minimal-mistakes/_search.scss | 98 +++ _sass/minimal-mistakes/_utilities.scss | 56 +- assets/js/_main.js | 39 +- assets/js/lunr-en.js | 2 +- assets/js/main.min.js | 10 +- assets/js/plugins/jquery.greedy-navigation.js | 55 +- 18 files changed, 703 insertions(+), 551 deletions(-) create mode 100644 _includes/search_form.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 8954209..32a565c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Disable comments in `development` environment. [#1363](https://github.com/mmistakes/minimal-mistakes/pull/1363) * Exclude specific pages/posts from search index by adding `search: false` to the YAML Front Matter. [#1369](https://github.com/mmistakes/minimal-mistakes/pull/1369) * Add optional `description` key to masthead links for clarifying their purpose with the `title` attribute. [#1380](https://github.com/mmistakes/minimal-mistakes/pull/1380) +* Incorporate site search into masthead. [#1383](https://github.com/mmistakes/minimal-mistakes/pull/1383) ### Bug Fixes diff --git a/_config.yml b/_config.yml index 3e65363..e96564f 100644 --- a/_config.yml +++ b/_config.yml @@ -51,6 +51,7 @@ reCaptcha: secret : atom_feed: path : # blank (default) uses feed.xml +search : # true, false (default) # SEO Related google_site_verification : diff --git a/_includes/masthead.html b/_includes/masthead.html index 623ff36..70ac7c6 100644 --- a/_includes/masthead.html +++ b/_includes/masthead.html @@ -15,7 +15,14 @@ {% endfor %} - + {% endif %} + diff --git a/_includes/scripts.html b/_includes/scripts.html index 8a454e7..ea03be3 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -11,7 +11,7 @@ {% endif %} -{% if page.layout == 'search' %} +{% if site.search == true or page.layout == 'search' %} {% endif %} diff --git a/_includes/search_form.html b/_includes/search_form.html new file mode 100644 index 0000000..b9bf70f --- /dev/null +++ b/_includes/search_form.html @@ -0,0 +1,4 @@ +
+ +
+
\ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index 39b9975..f3a8724 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -19,7 +19,15 @@ {% include browser-upgrade.html %} {% include masthead.html %} - {{ content }} +
+ {{ content }} +
+ + {% if site.search == true %} +
+ {% include search_form.html %} +
+ {% endif %}