Replace absolute_url with relative_url

This commit is contained in:
Michael Rose
2018-03-20 16:01:21 -04:00
parent a76c16ee23
commit 4d4531d19f
21 changed files with 132 additions and 132 deletions

View File

@ -30,7 +30,7 @@ feature_row:
- image_path: /assets/images/unsplash-gallery-image-3-th.jpg
title: "Placeholder 3"
excerpt: "This is some sample content that goes here with **Markdown** formatting."
last_modified_at: 2018-01-09T14:26:13-05:00
last_modified_at: 2018-03-20T16:00:09-04:00
toc: true
toc_label: "Helpers"
toc_icon: "cogs"
@ -40,11 +40,11 @@ You can think of these Jekyll helpers as little shortcuts. Since GitHub Pages do
## Base Path
**Deprecated**. Use `absolute_url` filter instead.
**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" | absolute_url }}{% endraw %}` ~> `https://yourdoamin.com/assets/images/filename.jpg`
**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
@ -125,12 +125,12 @@ And then drop-in the gallery include in the body where you'd like it to appear.
{% include gallery caption="This is a sample gallery with **Markdown support**." %}
**More Gallery Goodness:** A few more examples and [source code](https://github.com/{{ site.repository }}/blob/master/docs/_posts/2010-09-09-post-gallery.md) can be seen in [this sample gallery post]({{ "" | absolute_url }}{% post_url 2010-09-09-post-gallery %}).
**More Gallery Goodness:** A few more examples and [source code](https://github.com/{{ site.repository }}/blob/master/docs/_posts/2010-09-09-post-gallery.md) can be seen in [this sample gallery post]({{ "" | relative_url }}{% post_url 2010-09-09-post-gallery %}).
{: .notice--info}
## Feature Row
Designed to compliment the [`splash`]({{ "/docs/layouts/#splash-page-layout" | absolute_url }}) page layout as a way of arranging and aligning "feature blocks" containing text or image.
Designed to compliment the [`splash`]({{ "/docs/layouts/#splash-page-layout" | relative_url }}) page layout as a way of arranging and aligning "feature blocks" containing text or image.
To add a feature row containing three content blocks with text and image, add the following YAML Front Matter
@ -142,7 +142,7 @@ To add a feature row containing three content blocks with text and image, add th
| **excerpt** | Optional | Content block excerpt text. Markdown is allowed. | |
| **url** | Optional | URL that the button should link to. | |
| **btn_label** | Optional | Button text label. | `more_label` in UI Text data file. |
| **btn_class** | Optional | Button style. See [utility classes]({{ "/docs/utility-classes/#buttons" | absolute_url }}) for options. | `btn` |
| **btn_class** | Optional | Button style. See [utility classes]({{ "/docs/utility-classes/#buttons" | relative_url }}) for options. | `btn` |
```yaml
feature_row:
@ -175,7 +175,7 @@ And then drop-in the feature row include in the body where you'd like it to appe
{% include feature_row %}
**More Feature Row Goodness:** A [few more examples]({{ "/splash-page/" | absolute_url }}) and [source code](https://github.com/{{ site.repository }}/blob/master/docs/_pages/splash-page.md) can be seen in the demo site.
**More Feature Row Goodness:** A [few more examples]({{ "/splash-page/" | relative_url }}) and [source code](https://github.com/{{ site.repository }}/blob/master/docs/_pages/splash-page.md) can be seen in the demo site.
{: .notice--info}
## Responsive Video Embed
@ -229,7 +229,7 @@ header:
Auto-generated table of contents list for your posts and pages can be enabled using two methods.
![table of contents example]({{ "/assets/images/mm-toc-helper-example.jpg" | absolute_url }})
![table of contents example]({{ "/assets/images/mm-toc-helper-example.jpg" | relative_url }})
### Enabled via YAML Front Matter
@ -283,7 +283,7 @@ To include a Kramdown [auto-generated table of contents](https://kramdown.gettal
Include an unordered list of links to be used as sidebar navigation with the `nav_list` helper.
**1.** Start by adding a set of titles and URLs to `_data/navigation.yml` in the same way the [`main` navigation]({{ "/docs/navigation/" | absolute_url }}) is built.
**1.** Start by adding a set of titles and URLs to `_data/navigation.yml` in the same way the [`main` navigation]({{ "/docs/navigation/" | relative_url }}) is built.
`foo` navigation example: