mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-22 02:21:37 +01:00
cover: add rel="noopener noreferrer"
to links
This commit is contained in:
parent
361362773c
commit
4cc4604498
@ -5,7 +5,8 @@
|
|||||||
{{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }}
|
{{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }}
|
||||||
{{- $cover := (.Page.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
|
{{- $cover := (.Page.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
|
||||||
{{- 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">{{ end -}}
|
{{- 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") }}
|
||||||
{{- $prod := (eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production")) }}
|
{{- $prod := (eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production")) }}
|
||||||
@ -20,7 +21,8 @@
|
|||||||
<img src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}">
|
<img src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}{{/* For absolute urls and external links, no img processing here */}}
|
{{- else }}{{/* For absolute urls and external links, no img processing here */}}
|
||||||
{{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}" target="_blank">{{ end -}}
|
{{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}" target="_blank"
|
||||||
|
rel="noopener noreferrer">{{ end -}}
|
||||||
<img src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}">
|
<img src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $addLink }}</a>{{ end -}}
|
{{- if $addLink }}</a>{{ end -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user