Make Hero image work out-of-the box (#40)

* using Hero sample image in the theme's /static folder
* fall back to site config
* fall back to hard coded default if none set in page or site params
This commit is contained in:
Bjørn Erik Pedersen 2017-07-23 14:36:54 +02:00 committed by Bud Parr
parent 68aae3273c
commit 7b5196ad18
2 changed files with 1 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

View file

@ -1,4 +1,4 @@
{{ $featured_image := .Params.featured_image }}
{{ $featured_image := .Param "featured_image" | default "images/gohugo-default-sample-hero-image.jpg" }}
{{ if $featured_image }}
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
{{ $featured_image := (trim $featured_image "/") | absURL }}