fixed images display on smaller screens
[theme-danix.xyz.git] / layouts / partials / head-addition.html
index b298b5e..42eff42 100644 (file)
@@ -1,10 +1,16 @@
 {{/*
        * 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 }}
+               {{ with resources.Get . }}
+                       <style media="screen">
+                       #banner {
+                       background-image: url( {{ .Permalink }} );
+                       }
+                       </style>
+               {{ else }}
+                       {{ warnf "featured image not found: %s" . }}
+               {{ end }}
+       {{ end }}
 {{ end }}