fixed images display on smaller screens
[theme-danix.xyz.git] / layouts / partials / head-addition.html
index d975c51..42eff42 100644 (file)
@@ -2,15 +2,15 @@
        * Add the featured image to the header if it's present in the Front Matter
        */}}
 {{ if .IsPage }}
-       {{ if isset .Params "featured_image" }}
-       <style media="screen">
-               header#masthead {
-                       height: 60vh;
-                       background-image: url( {{ $.Params.featured_image | absURL }} );
-                       background-repeat: no-repeat;
-                       background-position: center center;
-                       background-attachment: fixed;
-               }
-       </style>
+       {{ 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 }}