Restruction

This commit is contained in:
2022-02-20 20:00:01 +01:00
parent 3491caf100
commit 10d0349955
22 changed files with 281 additions and 102 deletions
+29 -23
View File
@@ -1,25 +1,31 @@
{{- $cover := false -}}
{{- $autoCover := default $.Site.Params.autoCover false }}
{{ range where .Site.RegularPages "Type" "tiles" }}
{{- if index .Params "cover" -}}
{{- if .Resources.GetMatch .Params.Cover }}
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
{{- else -}}
{{- $cover = absURL .Params.Cover -}}
{{- end -}}
{{- else if $.Site.Params.AutoCover -}}
{{- if (not .Params.Cover) -}}
{{- if .Resources.GetMatch "cover.*" -}}
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ $count := partial "func/count_posts.html" ( dict "context" . "term" .Params.CorrespondingTagName ) }}
{{if $cover -}}
<!-- Cover image found -->
<a href="https://{{ .Params.urlLink }}">
<img src="{{ $cover }}"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
</a>
{{- end }}
<figure >
{{if .Params.Cover }}
<!-- Cover image found -- found in tiles -->
<a href="https://{{ .Params.urlLink }}">
<img src="{{ .Params.Cover }}"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" /></a>
{{ else }}
<!-- No cover image found -->
<a href="https://{{ .Params.urlLink }}">
{{ .Title | plainify | default " " }} </a>
{{ end }}
<figcaption >
{{ if gt $count 0 }}
<a href="tags/{{ .Params.CorrespondingTagName }}">
#{{ .Params.CorrespondingTagName | plainify }} <small>({{ $count }})</small> </a>
{{ end }}
</figcaption >
</figure>
{{ end }}