fix: correct permalink casing for OpenGraph and Twitter image tags (#1324)
This commit is contained in:
@@ -39,5 +39,5 @@
|
|||||||
|
|
||||||
{{ $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources "Context" .) }}
|
{{ $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources "Context" .) }}
|
||||||
{{- if $image -}}
|
{{- if $image -}}
|
||||||
<meta property='og:image' content='{{ absURL $image.permalink }}' />
|
<meta property='og:image' content='{{ absURL $image.Permalink }}' />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -12,5 +12,5 @@
|
|||||||
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources "Context" .) -}}
|
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources "Context" .) -}}
|
||||||
{{- if $image -}}
|
{{- if $image -}}
|
||||||
<meta name="twitter:card" content="{{ .Site.Params.opengraph.twitter.card }}">
|
<meta name="twitter:card" content="{{ .Site.Params.opengraph.twitter.card }}">
|
||||||
<meta name="twitter:image" content='{{ absURL $image.permalink }}' />
|
<meta name="twitter:image" content='{{ absURL $image.Permalink }}' />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
+1
-1
@@ -52,7 +52,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources "Context" .) -}}
|
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources "Context" .) -}}
|
||||||
{{- if $image -}}
|
{{- if $image -}}
|
||||||
{{- $imgTag := printf "<img src=\"%s\" alt=\"Featured image of post %s\" />" ($image.permalink | absURL) .Title -}}
|
{{- $imgTag := printf "<img src=\"%s\" alt=\"Featured image of post %s\" />" ($image.Permalink | absURL) .Title -}}
|
||||||
{{- $content = printf "%s%s" $imgTag $content -}}
|
{{- $content = printf "%s%s" $imgTag $content -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $content | transform.XMLEscape | safeHTML -}}
|
{{- $content | transform.XMLEscape | safeHTML -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user