Skip to content

Commit cff2493

Browse files
committed
fix(og): avoid double slashes when appending index.png
1 parent 8bbcae8 commit cff2493

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/pages/posts/[...slug]/index.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ if (typeof initOgImage === "string") {
8181
}
8282
8383
if (!ogImageUrl && config.features.dynamicOgImage) {
84-
ogImageUrl = `${getPostUrl(post.id, post.filePath, locale)}/index.png`;
84+
const postUrl = getPostUrl(post.id, post.filePath, locale).replace(
85+
/\/+$/,
86+
""
87+
);
88+
ogImageUrl = `${postUrl}/index.png`;
8589
}
8690
8791
const ogImage = ogImageUrl

0 commit comments

Comments
 (0)