From 282806ae07eb3975624dd928600afdee9bd811fc Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 15 Jan 2019 09:07:56 -0500 Subject: [PATCH] Add logo and title customization to the masthead (#2026) * Add logo and title customization to the masthead * Adjust config description * Add test site logo to `/test` * Document `site.logo` and `site.masthead_title` * Update CHANGELOG and history --- CHANGELOG.md | 1 + _config.yml | 2 ++ _includes/masthead.html | 9 ++++++++- _sass/minimal-mistakes/_masthead.scss | 4 ++++ _sass/minimal-mistakes/_navigation.scss | 5 +++++ docs/_config.yml | 2 ++ docs/_docs/05-configuration.md | 23 ++++++++++++++++++++++- docs/_docs/18-history.md | 3 ++- docs/assets/images/mm-masthead-logo.png | Bin 0 -> 28648 bytes test/_config.yml | 2 ++ test/assets/images/apple-touch-icon.png | Bin 0 -> 1464 bytes 11 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 docs/assets/images/mm-masthead-logo.png create mode 100644 test/assets/images/apple-touch-icon.png diff --git a/CHANGELOG.md b/CHANGELOG.md index ed4d9932..fd9529b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Enhancements +- Add logo and title customization to the masthead. [#2026](https://github.com/mmistakes/minimal-mistakes/pull/2026) - Add support to customize `issue-term` for utterances comment provider. [#2022](https://github.com/mmistakes/minimal-mistakes/pull/2022) - Allow custom canonical url on a page-by-page basis. [#2021](https://github.com/mmistakes/minimal-mistakes/pull/2021) - Update table of contents navigation based on scroll position to indicate which link is currently active in the viewport. [#2020](https://github.com/mmistakes/minimal-mistakes/pull/2020) diff --git a/_config.yml b/_config.yml index ae48ca31..689c38af 100644 --- a/_config.yml +++ b/_config.yml @@ -24,6 +24,8 @@ url : # the base hostname & protocol for your site e.g. "ht baseurl : # the subpath of your site, e.g. "/blog" repository : # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" teaser : # path of fallback teaser image, e.g. "/assets/images/500x300.png" +logo : # path of logo image to display in the masthead, e.g. "/assets/images/88x88.png" +masthead_title : # overrides the website title displayed in the masthead, use " " for no title # breadcrumbs : false # true, false (default) words_per_minute : 200 comments: diff --git a/_includes/masthead.html b/_includes/masthead.html index f36d2c6e..f3ee59e9 100644 --- a/_includes/masthead.html +++ b/_includes/masthead.html @@ -1,8 +1,15 @@ +{% if site.logo contains "://" %} + {% capture logo_path %}{{ site.logo }}{% endcapture %} +{% else %} + {% capture logo_path %}{{ site.logo | relative_url }}{% endcapture %} +{% endif %} +