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