diff --git a/_includes/head.html b/_includes/head.html index f4d1bd2e32..138bd6c394 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -5,9 +5,9 @@ {% if site.owner.twitter %} {% if page.image.feature %} - + {% else %} -{% endif %} +{% endif %} {% endif %} @@ -58,6 +58,5 @@ {% if page.image.background or site.background %} {% capture background %}{% if page.image.background %}{{ page.image.background }}{% else %}{{ site.background }}{% endif %}{% endcapture %} -{% unless background contains 'http://' or background contains 'https://' %}{% capture background %}{{ site.url }}/images/{{ background }}{% endcapture %}{% endunless %} - + {% endif %} diff --git a/_includes/image_path b/_includes/image_path new file mode 100644 index 0000000000..7ac8ecc3e3 --- /dev/null +++ b/_includes/image_path @@ -0,0 +1,11 @@ +{% comment %} +This file will prepend the image path `{{site.url}}/images/` to any image +that does not have two slashes `//` in the path. That way, an image url that +points to another website won't automatically have this website mistakenly +added to the front of the url. + +A string beginning with a single slash will be prepended with {{ site.url }} + +This file must NOT have an extra carriage return at the end. + +{% endcomment %}{% capture first %}{{ include.image | truncate: 1, '' }}{% endcapture %}{% if include.image contains '//' %}{{ include.image }}{% elsif first == '/' %}{{ site.url }}{{ include.image }}{% else %}{{ site.url }}/images/{{ include.image }}{% endif %} \ No newline at end of file diff --git a/_includes/navigation.html b/_includes/navigation.html index 1b5456f159..13fbf4961f 100644 --- a/_includes/navigation.html +++ b/_includes/navigation.html @@ -6,7 +6,7 @@ About