fixed issues with images not showing up in header on single articles. Gallery and...
authordanix <danix@danix.xyz>
Sun, 12 Mar 2023 10:11:43 +0000 (11:11 +0100)
committerdanix <danix@danix.xyz>
Sun, 12 Mar 2023 10:11:43 +0000 (11:11 +0100)
layouts/partials/head-addition.html
layouts/shortcodes/img.html [moved from layouts/shortcodes/gallery-img.html with 100% similarity]

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 }}