Skip to content

Commit 6367287

Browse files
johanrinclaude
andcommitted
Fix JSON-LD image URL for page bundles in social shares
The structured data image URL used absURL which resolved post-cover.png to the site root instead of the post directory. Some platforms like LinkedIn use JSON-LD for previews, causing the site cover to display instead of the post cover. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ae14c68 commit 6367287

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

layouts/partials/meta/post.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"dateModified": "{{ dateFormat "2006-01-02" .Lastmod }}",
5454
"image": {
5555
"@type": "ImageObject",
56-
"url": "{{ with .Params.images }}{{ index . 0 | absURL }}{{ end }}",
56+
"url": "{{ with .Params.images }}{{ $img := index . 0 }}{{ if eq $.Kind "page" }}{{ printf "%s%s" $.Permalink $img }}{{ else }}{{ $img | absURL }}{{ end }}{{ end }}",
5757
"width": 1200,
5858
"height": 630
5959
},

0 commit comments

Comments
 (0)