refactor: image handling logic + support for external images (#1235)
* refactor: simplify image partial logic, remove generation of different image sizes * Remove `defaultImage.opengraph` configuration from `params.toml`.
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
<meta name="twitter:title" {{ printf "content=%q" $title | safeHTMLAttr }}>
|
||||
<meta name="twitter:description" {{ printf "content=%q" $description | safeHTMLAttr }}>
|
||||
|
||||
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}}
|
||||
{{- if $image.exists -}}
|
||||
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}}
|
||||
{{- if $image -}}
|
||||
<meta name="twitter:card" content="{{ default `summary_large_image` .Site.Params.opengraph.twitter.card }}">
|
||||
<meta name="twitter:image" content='{{ absURL $image.permalink }}' />
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user