working on the header image. Still does't show images set in front matter.
[theme-danix.xyz.git] / layouts / partials / head-addition.html
index b298b5e..40ac3a0 100644 (file)
@@ -1,10 +1,14 @@
 {{/*
        * Add the featured image to the header if it's present in the Front Matter
        */}}
-{{ if isset .Params "featured_image" }}
-<style media="screen">
-       header#masthead {
-               background-image: url( {{ $.Params.featured_image | urlize }} );
-       }
-</style>
+{{ if .IsPage }}
+       {{ with $.Params.featured_image }}
+               {{ $source := $.Params.featured_image }}
+               {{ $image := resources.Get $source }}
+               <style media="screen">
+                       #banner {
+                               background-image: url( {{ $image.Permalink }} );
+                       }
+               </style>
+       {{ end }}
 {{ end }}