Allow images to be placed in other folders

- Remove `images/` only restriction and encourage placement in `assets/images/` instead
This commit is contained in:
Michael Rose 2016-09-21 22:15:17 -04:00
parent 4a26d61008
commit 77c5642803
7 changed files with 19 additions and 19 deletions

View file

@ -20,7 +20,7 @@
{% if teaser contains "://" %} {% if teaser contains "://" %}
"{{ teaser }}" "{{ teaser }}"
{% else %} {% else %}
"{{ teaser | prepend: "/images/" | prepend: base_path }}" "{{ teaser | prepend: "/" | prepend: base_path }}"
{% endif %} {% endif %}
alt=""> alt="">
</div> </div>

View file

@ -8,9 +8,9 @@
<div class="author__avatar"> <div class="author__avatar">
{% if author.avatar contains "://" %} {% if author.avatar contains "://" %}
<img src="{{ author.avatar }}" alt="{{ author.name }}"> <img src="{{ author.avatar | prepend: "/" }}" alt="{{ author.name }}">
{% else %} {% else %}
<img src="{{ author.avatar | prepend: "/images/" | prepend: base_path }}" class="author__avatar" alt="{{ author.name }}"> <img src="{{ author.avatar | prepend: "/" | prepend: base_path }}" class="author__avatar" alt="{{ author.name }}">
{% endif %} {% endif %}
</div> </div>

View file

@ -13,7 +13,7 @@
{% if f.url contains "://" %} {% if f.url contains "://" %}
{% capture f_url %}{{ f.url }}{% endcapture %} {% capture f_url %}{{ f.url }}{% endcapture %}
{% else %} {% else %}
{% capture f_url %}{{ f.url | prepend: base_path }}{% endcapture %} {% capture f_url %}{{ f.url | prepend: "/" | prepend: base_path }}{% endcapture %}
{% endif %} {% endif %}
<div class="feature__item{% if include.type %}--{{ include.type }}{% endif %}"> <div class="feature__item{% if include.type %}--{{ include.type }}{% endif %}">
@ -24,7 +24,7 @@
{% if f.image_path contains "://" %} {% if f.image_path contains "://" %}
"{{ f.image_path }}" "{{ f.image_path }}"
{% else %} {% else %}
"{{ f.image_path | prepend: "/images/" | prepend: base_path }}" "{{ f.image_path | prepend: "/" | prepend: base_path }}"
{% endif %} {% endif %}
alt="{% if f.alt %}{{ f.alt }}{% endif %}"> alt="{% if f.alt %}{{ f.alt }}{% endif %}">
</div> </div>

View file

@ -21,7 +21,7 @@
{% if img.url contains "://" %} {% if img.url contains "://" %}
"{{ img.url }}" "{{ img.url }}"
{% else %} {% else %}
"{{ img.url | prepend: "/images/" | prepend: base_path }}" "{{ img.url | prepend: "/" | prepend: base_path }}"
{% endif %} {% endif %}
{% if img.title %}title="{{ img.title }}"{% endif %} {% if img.title %}title="{{ img.title }}"{% endif %}
> >
@ -29,7 +29,7 @@
{% if img.image_path contains "://" %} {% if img.image_path contains "://" %}
"{{ img.image_path }}" "{{ img.image_path }}"
{% else %} {% else %}
"{{ img.image_path | prepend: "/images/" | prepend: base_path }}" "{{ img.image_path | prepend: "/" | prepend: base_path }}"
{% endif %} {% endif %}
alt="{% if img.alt %}{{ img.alt }}{% endif %}"> alt="{% if img.alt %}{{ img.alt }}{% endif %}">
</a> </a>
@ -38,7 +38,7 @@
{% if img.image_path contains "://" %} {% if img.image_path contains "://" %}
"{{ img.image_path }}" "{{ img.image_path }}"
{% else %} {% else %}
"{{ img.image_path | prepend: "/images/" | prepend: base_path }}" "{{ img.image_path | prepend: "/" | prepend: base_path }}"
{% endif %} {% endif %}
alt="{% if img.alt %}{{ img.alt }}{% endif %}"> alt="{% if img.alt %}{{ img.alt }}{% endif %}">
{% endif %} {% endif %}

View file

@ -3,7 +3,7 @@
{% if page.header.image contains "://" %} {% if page.header.image contains "://" %}
{% capture img_path %}{{ page.header.image }}{% endcapture %} {% capture img_path %}{{ page.header.image }}{% endcapture %}
{% else %} {% else %}
{% capture img_path %}{{ page.header.image | prepend: "/images/" | prepend: base_path }}{% endcapture %} {% capture img_path %}{{ page.header.image | prepend: "/" | prepend: base_path }}{% endcapture %}
{% endif %} {% endif %}
{% if page.header.cta_url contains "://" %} {% if page.header.cta_url contains "://" %}
@ -15,7 +15,7 @@
{% if page.header.overlay_image contains "://" %} {% if page.header.overlay_image contains "://" %}
{% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %} {% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %}
{% elsif page.header.overlay_image %} {% elsif page.header.overlay_image %}
{% capture overlay_img_path %}{{ page.header.overlay_image | prepend: "/images/" | prepend: base_path }}{% endcapture %} {% capture overlay_img_path %}{{ page.header.overlay_image | prepend: "/" | prepend: base_path }}{% endcapture %}
{% endif %} {% endif %}
{% if page.header.overlay_filter contains "rgba" %} {% if page.header.overlay_filter contains "rgba" %}

View file

@ -60,13 +60,13 @@
{% if page.header.image %} {% if page.header.image %}
<meta name="twitter:card" content="summary_large_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: "/images/" | prepend: base_path }}{% endif %}"> <meta name="twitter:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | prepend: "/" | prepend: base_path }}{% endif %}">
{% else %} {% else %}
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
{% if page.header.teaser %} {% if page.header.teaser %}
<meta name="twitter:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | prepend: "/images/" | prepend: base_path }}{% endif %}"> <meta name="twitter:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | prepend: "/" | prepend: base_path }}{% endif %}">
{% elsif site.og_image %} {% elsif site.og_image %}
<meta name="twitter:image" content="{{ site.og_image | prepend: "/images/" | prepend: base_path }}"> <meta name="twitter:image" content="{{ site.og_image | prepend: "/" | prepend: base_path }}">
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -86,13 +86,13 @@
{% endif %} {% endif %}
{% if page.header.image %} {% if page.header.image %}
<meta property="og:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | prepend: "/images/" | prepend: base_path }}{% endif %}"> <meta property="og:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | prepend: "/" | prepend: base_path }}{% endif %}">
{% elsif page.header.overlay_image %} {% 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: "/images/" | prepend: base_path }}{% endif %}"> <meta property="og:image" content="{% if page.header.overlay_image contains "://" %}{{ page.header.overlay_image }}{% else %}{{ page.header.overlay_image | prepend: "/" | prepend: base_path }}{% endif %}">
{% elsif page.header.teaser %} {% elsif page.header.teaser %}
<meta property="og:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | prepend: "/images/" | prepend: base_path }}{% endif %}"> <meta property="og:image" content="{% if page.header.teaser contains "://" %}{{ page.header.teaser }}{% else %}{{ page.header.teaser | prepend: "/" | prepend: base_path }}{% endif %}">
{% elsif site.og_image %} {% elsif site.og_image %}
<meta property="og:image" content="{% if site.og_image contains "://" %}{{ site.og_image }}{% else %}{{ site.og_image | prepend: "/images/" | prepend: base_path }}{% endif %}"> <meta property="og:image" content="{% if site.og_image contains "://" %}{{ site.og_image }}{% else %}{{ site.og_image | prepend: "/" | prepend: base_path }}{% endif %}">
{% endif %} {% endif %}
{% if page.date %} {% if page.date %}
@ -113,7 +113,7 @@
"@context": "http://schema.org", "@context": "http://schema.org",
"@type": "Organization", "@type": "Organization",
"url": {{ seo_url | jsonify }}, "url": {{ seo_url | jsonify }},
"logo": {{ site.og_image | prepend: "/images/" | prepend: base_path | jsonify }} "logo": {{ site.og_image | prepend: "/" | prepend: base_path | jsonify }}
} }
</script> </script>
{% endif %} {% endif %}

View file

@ -10,7 +10,7 @@
{% if s.image contains "://" %} {% if s.image contains "://" %}
"{{ s.image }}" "{{ s.image }}"
{% else %} {% else %}
"{{ s.image | prepend: "/images/" | prepend: base_path }}" "{{ s.image | prepend: "/" | prepend: base_path }}"
{% endif %} {% endif %}
alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}"> alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}">
{% endif %} {% endif %}