Skip to content

Commit a95fae0

Browse files
committedSep 11, 2018
Properly apply relative_url filter to internal links in header overlay actions array
1 parent 90f5a98 commit a95fae0

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
- Remove deprecated `base_path` include helper.
66

7+
### Bug Fixes
8+
9+
- Properly apply `relative_url` filter to internal links in header overlay `actions` array.
10+
711
## [4.13.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.13.0)
812

913
### Enhancements

‎_includes/page__hero.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ <h1 id="page-title" class="page__title" itemprop="headline">
5454
{% if page.header.actions %}
5555
<p>
5656
{% for action in page.header.actions %}
57-
<a href="{{ action.url }}" class="btn btn--light-outline btn--large">{{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a>
57+
{% if action.url contains "://" %}
58+
{% assign url = action.url %}
59+
{% else %}
60+
{% assign url = action.url | relative_url %}
61+
{% endif %}
62+
<a href="{{ url }}" class="btn btn--light-outline btn--large">{{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a>
5863
{% endfor %}
5964
{% endif %}
6065
</div>

‎docs/_docs/18-history.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ permalink: /docs/history/
44
excerpt: "Change log of enhancements and bug fixes made to the theme."
55
sidebar:
66
nav: docs
7-
last_modified_at: 2018-09-11T09:58:11-04:00
7+
last_modified_at: 2018-09-11T11:42:10-04:00
88
toc: true
99
---
1010

@@ -14,6 +14,10 @@ toc: true
1414

1515
- Remove deprecated `base_path` include helper.
1616

17+
### Bug Fixes
18+
19+
- Properly apply `relative_url` filter to internal links in header overlay `actions` array.
20+
1721
## [4.13.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.13.0)
1822

1923
### Enhancements

‎test/_pages/splash-page.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ header:
77
overlay_color: "#000"
88
overlay_filter: "0.5"
99
overlay_image: /assets/images/unsplash-image-1.jpg
10-
cta_label: "Download"
1110
actions:
1211
- label: "Learn More"
13-
url: "https://github.com/mmistakes/minimal-mistakes/"
12+
url: "/terms/"
1413
caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
1514
excerpt: "Bacon ipsum dolor sit amet salami ham hock ham, hamburger corned beef short ribs kielbasa biltong t-bone drumstick tri-tip tail sirloin pork chop."
1615
intro:

0 commit comments

Comments
 (0)
Please sign in to comment.