fixed issues with images not showing up in header on single articles. Gallery and...
[theme-danix.xyz.git] / layouts / partials / head-addition.html
index 40ac3a0..42eff42 100644 (file)
@@ -3,12 +3,14 @@
        */}}
 {{ if .IsPage }}
        {{ with $.Params.featured_image }}
-               {{ $source := $.Params.featured_image }}
-               {{ $image := resources.Get $source }}
-               <style media="screen">
+               {{ with resources.Get . }}
+                       <style media="screen">
                        #banner {
-                               background-image: url( {{ $image.Permalink }} );
+                       background-image: url( {{ .Permalink }} );
                        }
-               </style>
+                       </style>
+               {{ else }}
+                       {{ warnf "featured image not found: %s" . }}
+               {{ end }}
        {{ end }}
 {{ end }}