diff --git a/CHANGELOG.md b/CHANGELOG.md index 631f980144b1..2e183aa6a64c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Update Indonesian localized UI text strings. [#2731](https://github.com/mmistakes/minimal-mistakes/pull/2731) - Update remote theme documentation. [#2734](https://github.com/mmistakes/minimal-mistakes/pull/2734) - Update allejo/jekyll-toc to v1.1.0, skip headings without an ID. [#2752](https://github.com/mmistakes/minimal-mistakes/pull/2752) +- Allow custom gradient for page header overlay. [#2806](https://github.com/mmistakes/minimal-mistakes/pull/2806) ## [4.21.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.21.0) diff --git a/_includes/page__hero.html b/_includes/page__hero.html index 3f55aaa60ac5..dd1c26fbf1fc 100644 --- a/_includes/page__hero.html +++ b/_includes/page__hero.html @@ -1,9 +1,13 @@ {% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %} -{% if page.header.overlay_filter contains "rgba" %} +{% if page.header.overlay_filter contains "gradient" %} {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} +{% elsif page.header.overlay_filter contains "rgba" %} + {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} + {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} {% elsif page.header.overlay_filter %} {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} + {% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} {% endif %} {% if page.header.image_description %} @@ -15,7 +19,7 @@ {% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %}