diff --git a/layouts/partials/helpers/image.html b/layouts/partials/helpers/image.html
index 2fc3c92..ed43ed5 100644
--- a/layouts/partials/helpers/image.html
+++ b/layouts/partials/helpers/image.html
@@ -13,19 +13,14 @@
{{ $result = merge $result (dict "permalink" $imageValue) }}
{{ else }}
- {{ $pageResourceImage := resources.GetMatch (printf "%s" ($imageValue | safeURL)) }}
+ {{ $pageResourceImage := (.Context.Resources.GetMatch ($imageValue | safeURL)).Fill "300x300 center" }}
{{ if $pageResourceImage }}
{{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }}
-
-
- {{ if ne (path.Ext $imageValue) ".svg" }}
- {{ $result = merge $result (dict "resource" $pageResourceImage) }}
- {{ end }}
{{ else }}
- {{ $result = merge $result (dict "permalink" (relURL $imageValue)) }}
+ {{ $result = merge $result (dict "permalink" (printf "%s" (relURL $imageValue))) }}
{{ end }}
{{ end }}
@@ -42,8 +37,7 @@
{{ if $siteResourceImage }}
- {{ $result = merge $result (dict "permalink" $siteResourceImage.RelPermalink) }}
- {{ $result = merge $result (dict "resource" $siteResourceImage) }}
+ {{ $result = merge $result (dict "permalink" ($siteResourceImage.Fill "300x300 center").RelPermalink) }}
{{ else }}
{{ errorf "Failed loading image: %q" $defaultImageSetting.src }}
diff --git a/layouts/partials/opengraph/include.html b/layouts/partials/opengraph/include.html
index 743fb76..7ce8cf5 100644
--- a/layouts/partials/opengraph/include.html
+++ b/layouts/partials/opengraph/include.html
@@ -39,6 +39,6 @@
{{ $image := partial "helpers/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }}
{{ if $image.exists }}
-
+
{{- end -}}