From 98ee44245f55afe56ab034671cc6e9499483b97a Mon Sep 17 00:00:00 2001 From: Robpol86 Date: Sat, 2 Nov 2013 21:41:37 -0700 Subject: [PATCH] Re-implemented hotlinkable background. If the site or page background path doesn't contain http:// or https://, it will be assumed the image is located in the site's /images/ directory. However if either string is present in the background variable jekyll won't bother prepending the local path. --- _includes/head.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_includes/head.html b/_includes/head.html index 915b5e3..6e603f4 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -58,5 +58,7 @@ {% 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 %}