From 178d61ae379a77b6bcd83d81253e48dfad6fd6ee Mon Sep 17 00:00:00 2001 From: Robpol86 Date: Wed, 23 Oct 2013 22:16:02 -0500 Subject: [PATCH] Implemented per-page or site-wide background images. If the user sets "background: /path/to/image.jpg" or an http(s) url in their _config.yml, or if they set it in a post/page's yaml front matter, the displayed page will use that image as the background. If their background is transparent, the default background color will also be visible. Setting a background in a page/post will take precedence over the one set in _config.yml. --- _includes/head.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_includes/head.html b/_includes/head.html index bb238e4..767c2df 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -56,3 +56,11 @@ + + +{% if page.background %} + {% capture page_bgimg %}{% if page.background contains 'http' %}{{ page.background }}{% else %}{{ site.url }}{{ page.background }}{% endif %}{% endcapture %} +{% elsif site.background %} + {% capture page_bgimg %}{% if site.background contains 'http' %}{{ site.background }}{% else %}{{ site.url }}{{ site.background }}{% endif %}{% endcapture %} +{% endif %} +{% if page_bgimg %}{% endif %}