Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Remove prepend: "/" from includes and add to image path's instead
Browse files Browse the repository at this point in the history
  • Loading branch information
makaroniame committed Oct 10, 2016
1 parent 89f4b20 commit 727d1ae
Show file tree
Hide file tree
Showing 19 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion _includes/archive-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% if teaser contains "://" %}
"{{ teaser }}"
{% else %}
"{{ teaser | prepend: "/" | absolute_url }}"
"{{ teaser | absolute_url }}"
{% endif %}
alt="">
</div>
Expand Down
2 changes: 1 addition & 1 deletion _includes/author-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% if author.avatar contains "://" %}
<img src="{{ author.avatar }}" alt="{{ author.name }}">
{% else %}
<img src="{{ author.avatar | prepend: "/" | absolute_url }}" class="author__avatar" alt="{{ author.name }}">
<img src="{{ author.avatar | absolute_url }}" class="author__avatar" alt="{{ author.name }}">
{% endif %}
</div>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions _includes/feature_row
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% if f.url contains "://" %}
{% capture f_url %}{{ f.url }}{% endcapture %}
{% else %}
{% capture f_url %}{{ f.url | prepend: "/" | absolute_url }}{% endcapture %}
{% capture f_url %}{{ f.url | absolute_url }}{% endcapture %}
{% endif %}

<div class="feature__item{% if include.type %}--{{ include.type }}{% endif %}">
Expand All @@ -22,7 +22,7 @@
{% if f.image_path contains "://" %}
"{{ f.image_path }}"
{% else %}
"{{ f.image_path | prepend: "/" | absolute_url }}"
"{{ f.image_path | absolute_url }}"
{% endif %}
alt="{% if f.alt %}{{ f.alt }}{% endif %}">
</div>
Expand Down
6 changes: 3 additions & 3 deletions _includes/gallery
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
{% if img.url contains "://" %}
"{{ img.url }}"
{% else %}
"{{ img.url | prepend: "/" | absolute_url }}"
"{{ img.url | absolute_url }}"
{% endif %}
{% if img.title %}title="{{ img.title }}"{% endif %}
>
<img src=
{% if img.image_path contains "://" %}
"{{ img.image_path }}"
{% else %}
"{{ img.image_path | prepend: "/" | absolute_url }}"
"{{ img.image_path | absolute_url }}"
{% endif %}
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
</a>
Expand All @@ -36,7 +36,7 @@
{% if img.image_path contains "://" %}
"{{ img.image_path }}"
{% else %}
"{{ img.image_path | prepend: "/" | absolute_url }}"
"{{ img.image_path | absolute_url }}"
{% endif %}
alt="{% if img.alt %}{{ img.alt }}{% endif %}">
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions _includes/page__hero.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if page.header.image contains "://" %}
{% capture img_path %}{{ page.header.image }}{% endcapture %}
{% else %}
{% capture img_path %}{{ page.header.image | prepend: "/" | absolute_url }}{% endcapture %}
{% capture img_path %}{{ page.header.image | absolute_url }}{% endcapture %}
{% endif %}

{% if page.header.cta_url contains "://" %}
Expand All @@ -13,7 +13,7 @@
{% if page.header.overlay_image contains "://" %}
{% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %}
{% elsif page.header.overlay_image %}
{% capture overlay_img_path %}{{ page.header.overlay_image | prepend: "/" | absolute_url }}{% endcapture %}
{% capture overlay_img_path %}{{ page.header.overlay_image | absolute_url }}{% endcapture %}
{% endif %}

{% if page.header.overlay_filter contains "rgba" %}
Expand Down
16 changes: 8 additions & 8 deletions _includes/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@

{% if page.header.image %}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | prepend: "/" | absolute_url }}{% endif %}">
<meta name="twitter:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | absolute_url }}{% endif %}">
{% else %}
<meta name="twitter:card" content="summary">
{% if page.header.teaser %}
<meta name="twitter:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | prepend: "/" | absolute_url }}{% endif %}">
<meta name="twitter:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | absolute_url }}{% endif %}">
{% elsif site.og_image %}
<meta name="twitter:image" content="{{ site.og_image | prepend: "/" | absolute_url }}">
<meta name="twitter:image" content="{{ site.og_image | absolute_url }}">
{% endif %}
{% endif %}

Expand All @@ -84,13 +84,13 @@
{% endif %}

{% if page.header.image %}
<meta property="og:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | prepend: "/" | absolute_url }}{% endif %}">
<meta property="og:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | absolute_url }}{% endif %}">
{% elsif page.header.overlay_image %}
<meta property="og:image" content="{% if page.header.overlay_image contains "://" %}{{ page.header.overlay_image }}{% else %}{{ page.header.overlay_image | prepend: "/" | absolute_url }}{% endif %}">
<meta property="og:image" content="{% if page.header.overlay_image contains "://" %}{{ page.header.overlay_image }}{% else %}{{ page.header.overlay_image | absolute_url }}{% endif %}">
{% elsif page.header.teaser %}
<meta property="og:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | prepend: "/" | absolute_url }}{% endif %}">
<meta property="og:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | absolute_url }}{% endif %}">
{% elsif site.og_image %}
<meta property="og:image" content="{% if site.og_image contains "://" %}{{ site.og_image }}{% else %}{{ site.og_image | prepend: "/" | absolute_url }}{% endif %}">
<meta property="og:image" content="{% if site.og_image contains "://" %}{{ site.og_image }}{% else %}{{ site.og_image | absolute_url }}{% endif %}">
{% endif %}

{% if page.date %}
Expand All @@ -111,7 +111,7 @@
"@context": "http://schema.org",
"@type": "Organization",
"url": {{ seo_url | jsonify }},
"logo": {{ site.og_image | prepend: "/" | absolute_url | jsonify }}
"logo": {{ site.og_image | absolute_url | jsonify }}
}
</script>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% if s.image contains "://" %}
"{{ s.image }}"
{% else %}
"{{ s.image | prepend: "/" | absolute_url }}"
"{{ s.image | absolute_url }}"
{% endif %}
alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}">
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions example/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ description : "An amazing website."
url : # the base hostname & protocol for your site e.g. "https://mmistakes.github.io"
baseurl : # the subpath of your site, e.g. "/blog"
repository : # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes"
teaser : # filename of teaser fallback teaser image placed in /images/, .e.g. "500x300.png"
teaser : # path of fallback teaser image, e.g. "/assets/images/500x300.png"
# breadcrumbs : false # true, false (default)
words_per_minute : 200
comments:
Expand Down Expand Up @@ -80,7 +80,7 @@ analytics:
# Site Author
author:
name : "Your Name"
avatar : "assets/images/bio-photo.jpg"
avatar : "/assets/images/bio-photo.jpg"
bio : "I am an amazing person."
location : "Somewhere"
email :
Expand Down
4 changes: 2 additions & 2 deletions example/_data/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Billy Rick:
uri : "http://thewhip.com"
email : "[email protected]"
bio : "What do you want, jewels? I am a very extravagant man."
avatar : "bio-photo-2.jpg"
avatar : "/assets/images/bio-photo-2.jpg"
twitter : "extravagantman"
google_plus : "BillyRick"

Cornelius Fiddlebone:
name : "Cornelius Fiddlebone"
email : "[email protected]"
bio : "I ordered what?"
avatar : "bio-photo.jpg"
avatar : "/assets/images/bio-photo.jpg"
twitter : "rhymeswithsackit"
google_plus : "CorneliusFiddlebone"
12 changes: 6 additions & 6 deletions example/_pages/splash-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ date: 2016-03-23T11:48:41-04:00
header:
overlay_color: "#000"
overlay_filter: "0.5"
overlay_image: assets/images/unsplash-image-1.jpg
overlay_image: /assets/images/unsplash-image-1.jpg
cta_label: "Download"
cta_url: "https://github.com/mmistakes/minimal-mistakes/"
caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
Expand All @@ -18,34 +18,34 @@ feature_row:
alt: "placeholder image 1"
title: "Placeholder 1"
excerpt: "This is some sample content that goes here with **Markdown** formatting."
- image_path: assets/images/unsplash-gallery-image-2-th.jpg
- image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
title: "Placeholder 2"
excerpt: "This is some sample content that goes here with **Markdown** formatting."
url: "#test-link"
btn_label: "Read More"
btn_class: "btn--inverse"
- image_path: assets/images/unsplash-gallery-image-3-th.jpg
- 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."
feature_row2:
- image_path: assets/images/unsplash-gallery-image-2-th.jpg
- image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
title: "Placeholder Image Left Aligned"
excerpt: 'This is some sample content that goes here with **Markdown** formatting. Left aligned with `type="left"`'
url: "#test-link"
btn_label: "Read More"
btn_class: "btn--inverse"
feature_row3:
- image_path: assets/images/unsplash-gallery-image-2-th.jpg
- image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
title: "Placeholder Image Right Aligned"
excerpt: 'This is some sample content that goes here with **Markdown** formatting. Right aligned with `type="right"`'
url: "#test-link"
btn_label: "Read More"
btn_class: "btn--inverse"
feature_row4:
- image_path: assets/images/unsplash-gallery-image-2-th.jpg
- image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
title: "Placeholder Image Center Aligned"
excerpt: 'This is some sample content that goes here with **Markdown** formatting. Centered with `type="center"`'
Expand Down
10 changes: 5 additions & 5 deletions example/_portfolio/foo-bar-website.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
title: "Foo Bar Identity"
excerpt: "Foo Bar design system including logo mark, website design, and branding applications."
header:
image: assets/images/foo-bar-identity.jpg
teaser: assets/images/foo-bar-identity-th.jpg
image: /assets/images/foo-bar-identity.jpg
teaser: /assets/images/foo-bar-identity-th.jpg
sidebar:
- title: "Role"
image: http://placehold.it/350x250
Expand All @@ -12,13 +12,13 @@ sidebar:
- title: "Responsibilities"
text: "Reuters try PR stupid commenters should isn't a business model"
gallery:
- url: assets/images/unsplash-gallery-image-1.jpg
- url: /assets/images/unsplash-gallery-image-1.jpg
image_path: assets/images/unsplash-gallery-image-1-th.jpg
alt: "placeholder image 1"
- url: assets/images/unsplash-gallery-image-2.jpg
- url: /assets/images/unsplash-gallery-image-2.jpg
image_path: assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
- url: assets/images/unsplash-gallery-image-3.jpg
- url: /assets/images/unsplash-gallery-image-3.jpg
image_path: assets/images/unsplash-gallery-image-3-th.jpg
alt: "placeholder image 3"
---
Expand Down
2 changes: 1 addition & 1 deletion example/_posts/2010-08-05-post-image-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
- Post Formats
---

The preferred way of using images is placing them in the `assets/images/` directory and referencing them with an absolute path. Prepending the filename with `{% raw %}{{ site.url }}{{ site.baseurl }}/assets/images/{% endraw %}` will make sure your images display properly in feeds and such.
The preferred way of using images is placing them in the `/assets/images/` directory and referencing them with an absolute path. Prepending the filename with `{% raw %}{{ site.url }}{{ site.baseurl }}/assets/images/{% endraw %}` will make sure your images display properly in feeds and such.

Standard image with no width modifier classes applied.

Expand Down
68 changes: 34 additions & 34 deletions example/_posts/2010-09-09-post-gallery.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,52 @@ tags:
- Post Formats
- tiled
gallery:
- url: assets/images/unsplash-gallery-image-1.jpg
image_path: assets/images/unsplash-gallery-image-1-th.jpg
- url: /assets/images/unsplash-gallery-image-1.jpg
image_path: /assets/images/unsplash-gallery-image-1-th.jpg
alt: "placeholder image 1"
title: "Image 1 title caption"
- url: assets/images/unsplash-gallery-image-2.jpg
image_path: assets/images/unsplash-gallery-image-2-th.jpg
- url: /assets/images/unsplash-gallery-image-2.jpg
image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
title: "Image 2 title caption"
- url: assets/images/unsplash-gallery-image-3.jpg
image_path: assets/images/unsplash-gallery-image-3-th.jpg
- url: /assets/images/unsplash-gallery-image-3.jpg
image_path: /assets/images/unsplash-gallery-image-3-th.jpg
alt: "placeholder image 3"
title: "Image 3 title caption"
- url: assets/images/unsplash-gallery-image-1.jpg
image_path: assets/images/unsplash-gallery-image-1-th.jpg
- url: /assets/images/unsplash-gallery-image-1.jpg
image_path: /assets/images/unsplash-gallery-image-1-th.jpg
alt: "placeholder image 4"
title: "Image 4 title caption"
- url: assets/images/unsplash-gallery-image-2.jpg
image_path: assets/images/unsplash-gallery-image-2-th.jpg
- url: /assets/images/unsplash-gallery-image-2.jpg
image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 5"
title: "Image 5 title caption"
- url: assets/images/unsplash-gallery-image-3.jpg
image_path: assets/images/unsplash-gallery-image-3-th.jpg
- url: /assets/images/unsplash-gallery-image-3.jpg
image_path: /assets/images/unsplash-gallery-image-3-th.jpg
alt: "placeholder image 6"
title: "Image 6 title caption"
- url: assets/images/unsplash-gallery-image-1.jpg
image_path: assets/images/unsplash-gallery-image-1-th.jpg
- url: /assets/images/unsplash-gallery-image-1.jpg
image_path: /assets/images/unsplash-gallery-image-1-th.jpg
alt: "placeholder image 7"
title: "Image 7 title caption"
- url: assets/images/unsplash-gallery-image-2.jpg
image_path: assets/images/unsplash-gallery-image-2-th.jpg
- url: /assets/images/unsplash-gallery-image-2.jpg
image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 8"
title: "Image 8 title caption"
- url: assets/images/unsplash-gallery-image-3.jpg
image_path: assets/images/unsplash-gallery-image-3-th.jpg
- url: /assets/images/unsplash-gallery-image-3.jpg
image_path: /assets/images/unsplash-gallery-image-3-th.jpg
alt: "placeholder image 9"
title: "Image 9 title caption"
- url: assets/images/unsplash-gallery-image-1.jpg
image_path: assets/images/unsplash-gallery-image-1-th.jpg
- url: /assets/images/unsplash-gallery-image-1.jpg
image_path: /assets/images/unsplash-gallery-image-1-th.jpg
alt: "placeholder image 10"
title: "Image 10 title caption"
- url: assets/images/unsplash-gallery-image-2.jpg
image_path: assets/images/unsplash-gallery-image-2-th.jpg
- url: /assets/images/unsplash-gallery-image-2.jpg
image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 11"
title: "Image 11 title caption"
- url: assets/images/unsplash-gallery-image-3.jpg
image_path: assets/images/unsplash-gallery-image-3-th.jpg
- url: /assets/images/unsplash-gallery-image-3.jpg
image_path: /assets/images/unsplash-gallery-image-3-th.jpg
alt: "placeholder image 12"
title: "Image 12 title caption"
gallery2:
Expand All @@ -66,9 +66,9 @@ gallery2:
image_path: https://farm5.staticflickr.com/4046/4697502929_72c612c636_q.jpg
alt: "Fog in the trees"
gallery3:
- image_path: assets/images/unsplash-gallery-image-2-th.jpg
- image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
- image_path: assets/images/unsplash-gallery-image-4-th.jpg
- image_path: /assets/images/unsplash-gallery-image-4-th.jpg
alt: "placeholder image 4"
---

Expand All @@ -78,20 +78,20 @@ To place a gallery add the necessary YAML Front Matter:

```yaml
gallery:
- url: assets/images/unsplash-gallery-image-1.jpg
image_path: assets/images/unsplash-gallery-image-1-th.jpg
- url: /assets/images/unsplash-gallery-image-1.jpg
image_path: /assets/images/unsplash-gallery-image-1-th.jpg
alt: "placeholder image 1"
title: "Image 1 title caption"
- url: assets/images/unsplash-gallery-image-2.jpg
image_path: assets/images/unsplash-gallery-image-2-th.jpg
- url: /assets/images/unsplash-gallery-image-2.jpg
image_path: /assets/images/unsplash-gallery-image-2-th.jpg
alt: "placeholder image 2"
title: "Image 2 title caption"
- url: assets/images/unsplash-gallery-image-3.jpg
image_path: assets/images/unsplash-gallery-image-3-th.jpg
- url: /assets/images/unsplash-gallery-image-3.jpg
image_path: /assets/images/unsplash-gallery-image-3-th.jpg
alt: "placeholder image 3"
title: "Image 3 title caption"
- url: assets/images/unsplash-gallery-image-4.jpg
image_path: assets/images/unsplash-gallery-image-4-th.jpg
- url: /assets/images/unsplash-gallery-image-4.jpg
image_path: /assets/images/unsplash-gallery-image-4-th.jpg
alt: "placeholder image 4"
title: "Image 4 title caption"
```
Expand Down
4 changes: 2 additions & 2 deletions example/_posts/2012-03-15-layout-author-override.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Billy Rick:
uri: "http://thewhip.com"
email: "[email protected]"
bio: "What do you want, jewels? I am a very extravagant man."
avatar: "assets/images/bio-photo-2.jpg"
avatar: "/assets/images/bio-photo-2.jpg"
twitter: "extravagantman"

Cornelius Fiddlebone:
name: "Cornelius Fiddlebone"
email: "[email protected]"
bio: "I ordered what?"
avatar: "assets/images/bio-photo.jpg"
avatar: "/assets/images/bio-photo.jpg"
twitter: "rhymeswithsackit"
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Layout: Header Image (Horizontal)"
header:
image: assets/images/unsplash-image-1.jpg
image: /assets/images/unsplash-image-1.jpg
caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
categories:
- Layout
Expand Down
Loading

0 comments on commit 727d1ae

Please sign in to comment.