mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 03:00:50 +02:00
feat: rename old Params.header to Params.banner
Avoid conflict with new `header` param that configures site header
This commit is contained in:
parent
9e1704c71f
commit
963107a536
1 changed files with 6 additions and 6 deletions
|
@ -14,12 +14,12 @@
|
|||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{/* Header image */}}
|
||||
{{ if and .Params.header.image (not (and $featured (not .Params.image.preview_only))) }}
|
||||
{{/* Banner image */}}
|
||||
{{ if and .Params.banner.image (not (and $featured (not .Params.image.preview_only))) }}
|
||||
<div class="article-header">
|
||||
{{- $img := "" -}}
|
||||
{{ $alt := (.Params.header.caption | default "") | plainify }}
|
||||
{{ $destination := .Params.header.image }}
|
||||
{{ $alt := (.Params.banner.caption | default "") | plainify }}
|
||||
{{ $destination := .Params.banner.image }}
|
||||
{{ $is_remote := strings.HasPrefix $destination "http" }}
|
||||
{{- if not $is_remote -}}
|
||||
{{- $img = (.Page.Resources.ByType "image").GetMatch $destination -}}
|
||||
|
@ -30,10 +30,10 @@
|
|||
{{ if $img }}
|
||||
<img src="{{$img.RelPermalink}}" width="{{$img.Width}}" height="{{$img.Height}}" class="article-banner" alt="{{$alt}}">
|
||||
{{ else }}
|
||||
<img src="{{ .Params.header.image }}" class="article-banner" alt="{{$alt}}">
|
||||
<img src="{{ .Params.banner.image }}" class="article-banner" alt="{{$alt}}">
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.header.caption }}<span class="article-header-caption">{{ . | markdownify | emojify }}</span>{{ end }}
|
||||
{{ with .Params.banner.caption }}<span class="article-header-caption">{{ . | markdownify | emojify }}</span>{{ end }}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue