diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-27 00:32:19 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-27 00:32:19 +0200 |
| commit | 190b434dd9ad9627440787623de0ca9452f343f3 (patch) | |
| tree | 4d376c182b6a52a2724b536d6b88d03ae665d479 /layouts/partials/templates/opengraph.html | |
| parent | 1e5239d9116d0cc3128131e0d613a25b3efece9b (diff) | |
| download | gohugo-theme-ed-190b434dd9ad9627440787623de0ca9452f343f3.tar.gz | |
Fix microdate templates to proper render image
Diffstat (limited to 'layouts/partials/templates/opengraph.html')
| -rw-r--r-- | layouts/partials/templates/opengraph.html | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 5b81f94..89f1797 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -6,12 +6,8 @@ {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) -}} -{{- $image := "" -}} -{{- with .Params.featured_image -}} - {{- $image := .Resources.GetMatch .Params.featured_image -}} -{{- end -}} - -{{- if and .IsPage $image }} +{{- if and .IsPage .Params.featured_image -}} + {{- $image := .Resources.GetMatch .Params.featured_image }} <meta property="og:image" content="{{ $image.Permalink }}"> <meta property="og:image:width" content="{{ $image.Width }}"> <meta property="og:image:height" content="{{ $image.Height }}"> |
