From f077ec43437df33f07c1a15b7e4988616d0e138d Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Mon, 2 May 2016 13:59:31 +0200 Subject: [PATCH 1/3] Add overlay_filter param to hero headers The `overlay_filter` param lets you darken or otherwise filter the hero header picture to make the text content pop out more. You can use it by specifying the opacity (between 0 and 1) of a black overlay like so: ```yaml excerpt: "This post should display a **header with an overlay image**, if the theme supports it." header: overlay_image: unsplash-image-1.jpg overlay_filter: 0.5 # same as adding an opacity of 0.5 to a black background caption: "Photo credit: [**Unsplash**](https://unsplash.com)" cta_label: "More Info" cta_url: "https://unsplash.com" ``` Or if you want to do more fancy things, go full rgba: ```yaml excerpt: "This post should display a **header with an overlay image**, if the theme supports it." header: overlay_image: unsplash-image-1.jpg overlay_filter: rgba(255, 0, 0, 0.5) caption: "Photo credit: [**Unsplash**](https://unsplash.com)" cta_label: "More Info" cta_url: "https://unsplash.com" ``` --- _includes/page__hero.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/_includes/page__hero.html b/_includes/page__hero.html index ef0f4ca5..fb90c3cf 100644 --- a/_includes/page__hero.html +++ b/_includes/page__hero.html @@ -18,8 +18,14 @@ {% capture overlay_img_path %}{{ page.header.overlay_image | prepend: "/images/" | prepend: base_path }}{% endcapture %} {% endif %} +{% if page.header.overlay_filter contains "rgba" %} + {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} +{% elsif page.header.overlay_filter %} + {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} +{% endif %} +
{% if page.header.overlay_color or page.header.overlay_image %}
@@ -46,4 +52,4 @@ {% if page.header.caption %} {{ page.header.caption | markdownify | remove: "

" | remove: "

" }}
{% endif %} -
\ No newline at end of file +
From 1edfcea306d9aea0af837be361fb0204c524da82 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Mon, 2 May 2016 14:25:26 +0200 Subject: [PATCH 2/3] Style fixes --- _includes/page__hero.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/page__hero.html b/_includes/page__hero.html index fb90c3cf..bdbf130b 100644 --- a/_includes/page__hero.html +++ b/_includes/page__hero.html @@ -25,7 +25,7 @@ {% endif %}
{% if page.header.overlay_color or page.header.overlay_image %}
From 2b77f7516c77086ea5b2420034d0cb114cc7f8fd Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Mon, 2 May 2016 11:45:01 -0400 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90e4a95f..8c9d86fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [3.1.4](https://github.com/mmistakes/minimal-mistakes/releases/tag/3.1.4) + +### Enhancements + +- Add overlay_filter param to hero headers [#298](https://github.com/mmistakes/minimal-mistakes/pull/298) + +### Maintenance + +- Fix `www` and `https` links in author profile include [#293](https://github.com/mmistakes/minimal-mistakes/pull/293) + ## [3.1.3](https://github.com/mmistakes/minimal-mistakes/releases/tag/3.1.3) ### Enhancements