From d57c3d97d8795ff82f8ce96472504e438b8e182d Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 11 Sep 2018 11:42:21 -0400 Subject: [PATCH] Properly apply `relative_url` filter to internal links in header overlay `actions` array --- CHANGELOG.md | 4 ++++ _includes/page__hero.html | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2c52ae..566edf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - Remove deprecated `base_path` include helper. +### Bug Fixes + +- Properly apply `relative_url` filter to internal links in header overlay `actions` array. + ## [4.13.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.13.0) ### Enhancements diff --git a/_includes/page__hero.html b/_includes/page__hero.html index c67c440..98bff72 100644 --- a/_includes/page__hero.html +++ b/_includes/page__hero.html @@ -54,7 +54,12 @@ {% if page.header.actions %}

{% for action in page.header.actions %} - {{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }} + {% if action.url contains "://" %} + {% assign url = action.url %} + {% else %} + {% assign url = action.url | relative_url %} + {% endif %} + {{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }} {% endfor %} {% endif %} -- 2.43.0