浏览代码

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
tags/1.25
Bjørn Erik Pedersen 7 年前
父节点
当前提交
7b5196ad18
共有 2 个文件被更改,包括 1 次插入1 次删除
  1. 二进制
      exampleSite/static/images/gohugo-default-sample-hero-image.jpg
  2. 1
    1
      layouts/partials/site-header.html

二进制
exampleSite/static/images/gohugo-default-sample-hero-image.jpg 查看文件


+ 1
- 1
layouts/partials/site-header.html 查看文件

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

正在加载...
取消
保存