- {{ if isset .Params "featured_image" }}
- <style media="screen">
- #banner {
- 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 }}