From 90f5a984062b370c609763279ccbb85b2bac234b Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 11 Sep 2018 09:58:22 -0400 Subject: [PATCH] Remove deprecated `base_path` include helper --- CHANGELOG.md | 6 ++++++ _includes/base_path | 5 ----- docs/_docs/02-structure.md | 1 - docs/_docs/14-helpers.md | 9 --------- docs/_docs/18-history.md | 8 +++++++- test/_pages/archive-layout-with-content.md | 7 +------ test/_pages/sitemap.md | 2 +- test/_posts/2010-08-07-post-image-caption.md | 4 +--- test/_posts/2012-03-15-layout-header-overlay-image.md | 6 ++---- 9 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 _includes/base_path diff --git a/CHANGELOG.md b/CHANGELOG.md index 828b829c..e2c52ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/_includes/base_path b/_includes/base_path deleted file mode 100644 index 36826c4f..00000000 --- a/_includes/base_path +++ /dev/null @@ -1,5 +0,0 @@ -{% if site.url %} - {% assign base_path = site.url | append: site.baseurl %} -{% else %} - {% assign base_path = site.github.url %} -{% endif %} \ No newline at end of file diff --git a/docs/_docs/02-structure.md b/docs/_docs/02-structure.md index ec064f3b..a177c572 100644 --- a/docs/_docs/02-structure.md +++ b/docs/_docs/02-structure.md @@ -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 diff --git a/docs/_docs/14-helpers.md b/docs/_docs/14-helpers.md index d7767790..5e9626c4 100644 --- a/docs/_docs/14-helpers.md +++ b/docs/_docs/14-helpers.md @@ -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. diff --git a/docs/_docs/18-history.md b/docs/_docs/18-history.md index 21caddcc..b855a494 100644 --- a/docs/_docs/18-history.md +++ b/docs/_docs/18-history.md @@ -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 diff --git a/test/_pages/archive-layout-with-content.md b/test/_pages/archive-layout-with-content.md index 4b6c010f..1616b07b 100644 --- a/test/_pages/archive-layout-with-content.md +++ b/test/_pages/archive-layout-with-content.md @@ -211,9 +211,4 @@ Still sticking with science and Albert Einstein's E = MC2, which shou ### Variable Tag -This allows you to denote variables. - -{% include base_path %} -{% for post in site.pages %} -{% include archive-single.html %} -{% endfor %} \ No newline at end of file +This allows you to denote variables. \ No newline at end of file diff --git a/test/_pages/sitemap.md b/test/_pages/sitemap.md index ebdd4053..24d4009d 100644 --- a/test/_pages/sitemap.md +++ b/test/_pages/sitemap.md @@ -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.

Pages

{% for post in site.pages %} diff --git a/test/_posts/2010-08-07-post-image-caption.md b/test/_posts/2010-08-07-post-image-caption.md index 227f7ece..d50d4635 100644 --- a/test/_posts/2010-08-07-post-image-caption.md +++ b/test/_posts/2010-08-07-post-image-caption.md @@ -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 %}
diff --git a/test/_posts/2012-03-15-layout-header-overlay-image.md b/test/_posts/2012-03-15-layout-header-overlay-image.md index 36bae479..4973a041 100644 --- a/test/_posts/2012-03-15-layout-header-overlay-image.md +++ b/test/_posts/2012-03-15-layout-header-overlay-image.md @@ -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. @@ -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 [...]" @@ -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 [...]"