mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2025-01-27 04:33:13 -05:00
Refactor 2
This commit is contained in:
parent
f198decc11
commit
a00f01147c
@ -8,9 +8,12 @@
|
|||||||
{{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
|
{{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
|
||||||
{{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
|
{{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
|
||||||
{{- $cover := (or $pageBundleCover $globalResourcesCover)}}
|
{{- $cover := (or $pageBundleCover $globalResourcesCover)}}
|
||||||
|
|
||||||
|
{{- if $addLink }}
|
||||||
|
<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank" rel="noopener noreferrer">
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if $cover -}}{{/* i.e it is present in page bundle */}}
|
{{- if $cover -}}{{/* i.e it is present in page bundle */}}
|
||||||
{{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank"
|
|
||||||
rel="noopener noreferrer">{{ end -}}
|
|
||||||
{{- $sizes := (slice "360" "480" "720" "1080" "1500") }}
|
{{- $sizes := (slice "360" "480" "720" "1080" "1500") }}
|
||||||
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
|
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
|
||||||
{{- if hugo.IsExtended -}}
|
{{- if hugo.IsExtended -}}
|
||||||
@ -33,10 +36,16 @@
|
|||||||
rel="noopener noreferrer">{{ end -}}
|
rel="noopener noreferrer">{{ end -}}
|
||||||
<img loading="{{$loading}}" src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}">
|
<img loading="{{$loading}}" src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $addLink }}</a>{{ end -}}
|
|
||||||
|
{{- if $addLink }}
|
||||||
|
</a>
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
{{/* Display Caption */}}
|
{{/* Display Caption */}}
|
||||||
{{- if $.IsSingle }}
|
{{- if $.IsSingle }}
|
||||||
{{ with .Params.cover.caption }}<p>{{ . | markdownify }}</p>{{- end }}
|
{{- with .Params.cover.caption }}
|
||||||
|
<p>{{ . | markdownify }}</p>
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</figure>
|
</figure>
|
||||||
{{- end }}{{/* End image */}}
|
{{- end }}{{/* End image */}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user