hugo-theme-terminal

My Fork of the Terminal Hugo Theme
git clone https://git.repetitions.de/hugo-theme-terminal

cover.html (775B)


 1 {{- $cover := false -}}
 2 {{- $autoCover := default $.Site.Params.autoCover false }}
 3 
 4 {{- if index .Params "cover" -}}
 5   {{- if .Resources.GetMatch .Params.Cover }}
 6     {{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
 7   {{- else -}}
 8     {{- $cover = absURL .Params.Cover -}}
 9   {{- end -}}
10 {{- else if $.Site.Params.AutoCover -}}
11   {{- if (not .Params.Cover) -}}
12     {{- if .Resources.GetMatch "cover.*" -}}
13       {{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
14     {{- end -}}
15   {{- end -}}
16 {{- end -}}
17 
18 {{if $cover -}}
19   <!-- Cover image found -->
20   <img src="{{ $cover }}"
21        class="post-cover center"
22        alt="{{ .Title | plainify | default " " }}"
23        title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
24 {{- end }}
25