Skip to content

Commit

Permalink
Remove deprecated base_path include helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes committed Sep 11, 2018
1 parent 022345b commit 590034f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 30 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

### Enhancements

- Remove deprecated `base_path` include helper.

## [4.13.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.13.0)

### Enhancements
Expand Down
5 changes: 0 additions & 5 deletions _includes/base_path

This file was deleted.

1 change: 0 additions & 1 deletion docs/_docs/02-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ minimal-mistakes
| ├── comments-providers # snippets for comments (Disqus, Facebook, Google+, and custom)
| ├── footer # custom snippets to add to site footer
| ├── head # custom snippets to add to site head
| ├── base_path # site.url + site.baseurl shortcut
| ├── feature_row # feature row helper
| ├── gallery # image gallery helper
| ├── group-by-array # group by array helper for archives
Expand Down
9 changes: 0 additions & 9 deletions docs/_docs/14-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ toc_icon: "cogs"

You can think of these Jekyll helpers as little shortcuts. Since GitHub Pages doesn't allow most plugins --- [custom tags](https://jekyllrb.com/docs/plugins/#tags) are out. Instead the theme leverages [**includes**](https://jekyllrb.com/docs/templates/#includes) to do something similar.

## Base Path

**Deprecated**. Use `relative_url` filter instead.

Instead of repeating `{% raw %}{{ site.url }}{{ site.baseurl }}{% endraw %}` over and over again to create absolute URLs, you can use `{% raw %}{{ base_path }}{% endraw %}` instead. Simply add `{% raw %}{% include base_path %}{% endraw %}` to layouts, posts, pages, collections, or other includes and you're good to go.

**ProTip:** It's a good practice to use absolute URL paths for assets (especially post images) so they correctly resolve in the site's XML feeds. Example: `{% raw %}{{ "/assets/images/filename.jpg" | relative_url }}{% endraw %}` ~> `https://yourdoamin.com/assets/images/filename.jpg`
{: .notice--info}

## Group by Array

[Jekyll Group-By-Array](https://github.com/mushishi78/jekyll-group-by-array) by Max White.
Expand Down
8 changes: 7 additions & 1 deletion docs/_docs/18-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ permalink: /docs/history/
excerpt: "Change log of enhancements and bug fixes made to the theme."
sidebar:
nav: docs
last_modified_at: 2018-09-10T19:36:45-04:00
last_modified_at: 2018-09-11T09:58:11-04:00
toc: true
---

## Unreleased

### Enhancements

- Remove deprecated `base_path` include helper.

## [4.13.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.13.0)

### Enhancements
Expand Down
7 changes: 1 addition & 6 deletions test/_pages/archive-layout-with-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,4 @@ Still sticking with science and Albert Einstein's E = MC<sup>2</sup>, which shou

### Variable Tag

This allows you to denote <var>variables</var>.

{% include base_path %}
{% for post in site.pages %}
{% include archive-single.html %}
{% endfor %}
This allows you to denote <var>variables</var>.
2 changes: 1 addition & 1 deletion test/_pages/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permalink: /sitemap/
author_profile: false
---

A list of all the posts and pages found on the site. For you robots out there is an [XML version]({{ base_path }}/sitemap.xml) available for digesting as well.
A list of all the posts and pages found on the site. For you robots out there is an [XML version]({{ '/sitemap.xml' | relative_url }}) available for digesting as well.

<h2>Pages</h2>
{% for post in site.pages %}
Expand Down
4 changes: 1 addition & 3 deletions test/_posts/2010-08-07-post-image-caption.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ tags:
- Post Formats
---

{% include base_path %}

{% capture fig_img %}
![Foo]({{ basepath }}/assets/images/unsplash-gallery-image-3.jpg)
![Foo]({{ '/assets/images/unsplash-gallery-image-3.jpg' | relative_url }})
{% endcapture %}

<figure>
Expand Down
6 changes: 2 additions & 4 deletions test/_posts/2012-03-15-layout-header-overlay-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ tags:
last_modified_at: 2016-05-02T11:39:01-04:00
---

{% include base_path %}

This post should display a **header with an overlay image**, if the theme supports it.

Non-square images can provide some unique styling issues.
Expand All @@ -30,7 +28,7 @@ This post tests overlay header images.

You can use it by specifying the opacity (between 0 and 1) of a black overlay like so:

![transparent black overlay]({{ basepath }}/assets/images/mm-header-overlay-black-filter.jpg)
![transparent black overlay]({{ '/assets/images/mm-header-overlay-black-filter.jpg' | relative_url }})

```yaml
excerpt: "This post should [...]"
Expand All @@ -45,7 +43,7 @@ header:
Or if you want to do more fancy things, go full rgba:
![transparent red overlay]({{ basepath }}/assets/images/mm-header-overlay-red-filter.jpg)
![transparent red overlay]({{ '/assets/images/mm-header-overlay-red-filter.jpg' | relative_url }})
```yaml
excerpt: "This post should [...]"
Expand Down

0 comments on commit 590034f

Please sign in to comment.