From d8a9ecc0febafdfced0e70be23776f320db02814 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Mon, 13 Mar 2017 15:23:04 -0400 Subject: [PATCH] Add support for `site.image` in mastnead --- README.md | 2 +- _includes/masthead.html | 14 ++++++++++---- _sass/basically-basic/_global.scss | 13 +++++++++++-- example/_config.yml | 7 ++++--- example/assets/images/100x100.png | Bin 0 -> 3546 bytes 5 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 example/assets/images/100x100.png diff --git a/README.md b/README.md index d115285..782eba5 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as ## Configuration -Configuration of site-wide elements (`lang`, `title`, `description`, `author`, etc.) happens in your project's `_config.yml`. See the [example configuration](example/_config.yml) in this repo for reference. +Configuration of site-wide elements (`lang`, `title`, `description`, `image`, `author`, etc.) happens in your project's `_config.yml`. See the [example configuration](example/_config.yml) in this repo for reference. ### Skin diff --git a/_includes/masthead.html b/_includes/masthead.html index 3ec039a..8a5b70e 100644 --- a/_includes/masthead.html +++ b/_includes/masthead.html @@ -1,18 +1,24 @@ +{% if site.image contains '://' %} + {% assign site_image = site.image %} +{% else %} + {% assign site_image = site.image | relative_url %} +{% endif %} +
{% if page.url == '/' %}

- {% if site.image %}{% endif %} - {{ site.title | escape }} + {% if site.image %}{% endif %} + {{ site.title | escape }}

{% else %}

- {% if site.image %}{% endif %} - {{ site.title | escape }} + {% if site.image %}{% endif %} + {{ site.title | escape }}

{% endif %} diff --git a/_sass/basically-basic/_global.scss b/_sass/basically-basic/_global.scss index ee6b8d5..225acfd 100644 --- a/_sass/basically-basic/_global.scss +++ b/_sass/basically-basic/_global.scss @@ -4,7 +4,7 @@ .site-title { margin: 0; - padding: 1.35rem 1rem; + padding: 1.8125rem 1rem; padding-right: calc(10vw + #{$navicon-width}); /* make room for sidebar toggle */ font-family: $base-font-family; @include fluid-type($min-vw, $max-vw, 20px, 24px); @@ -20,7 +20,16 @@ } a { + display: flex; + align-items: center; color: $text-color; text-decoration: none; } -} \ No newline at end of file +} + +.site-image { + margin-right: 0.5rem; + width: 50px; + height: 50px; + border-radius: 50%; +} diff --git a/example/_config.yml b/example/_config.yml index 29a5c58..56b8c2a 100644 --- a/example/_config.yml +++ b/example/_config.yml @@ -16,18 +16,19 @@ lang: en-US title: Your awesome title that could be long email: your-email@domain.com -description: > # this means to ignore newlines until "baseurl:" +description: > # this means to ignore newlines until "baseurl:" Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description. -baseurl: "/example" # the subpath of your site, e.g. /blog -url: "" # the base hostname & protocol for your site, e.g. http://example.com +baseurl: "/example" # the subpath of your site, e.g. /blog +url: "" # the base hostname & protocol for your site, e.g. http://example.com author: name: John Doe twitter: notareal_twitter picture: https://api.adorable.io/avatars/285/johndoe.png twitter_username: notareal_twitter github_username: notareal_github +image: /assets/images/100x100.png # ~100x100px # Build settings markdown: kramdown diff --git a/example/assets/images/100x100.png b/example/assets/images/100x100.png new file mode 100644 index 0000000000000000000000000000000000000000..7b613a9fe456111976954da702d787618a130530 GIT binary patch literal 3546 zcmcha*FPH$|HUIxd$#r}zC>*`tF1jEs8On7ui6xC&Bkg_MC}GGYVXlTOGWI>SE_cc z5}QzaM0oo96Mh%Zb8*h+>Rg=H>wWP#@g_zPdKxYo002M_)zg0b_qzO_s3`ur-*Too z06?SRp`~R4)zacO33%@6;r$E%(4)_NA7pMe!xo3bDq(-z6yz5^;tHka|M@_V6=WI@ zjWhwqBEW&#H*{H;MJ-&++sPntg3dZDv~QxFrl=2?OnN&^wRKkKkzUk$H429dIix<= z;>>#E)QsC6e5x5>av2Tkd}&D*DPLg8vb)`3bMw|v_bHHriHyOLtbNJV6$Clc29951 zRkE|o^?K1KyHb%Zm|2N76Yz`4>xfiAB`qNe0FBOs;=^z-`zkQQ4Bf*idkq>q$`qB2 zy(`OBKwVfZi0`iRJ}Fxh#|&hlz$*n@uo2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