Skip to content

Commit

Permalink
fix(og image): safe URL
Browse files Browse the repository at this point in the history
  • Loading branch information
giladgd committed Jul 12, 2024
1 parent 76b6f49 commit 4161acd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vitepress-plugin-og-image/src/vitepress/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ async function renderSVGAndRewriteHTML(
og: true,
twitter: true,
image: {
url: `${domain}/${relative(siteConfig.outDir, ogImageFilePathFullName).replaceAll(sep, '/')}`,
url: `${domain}/${
relative(siteConfig.outDir, ogImageFilePathFullName)
.split(sep)
.map(item => encodeURIComponent(item))
.join('/')
}`,
width,
height,
},
Expand Down

0 comments on commit 4161acd

Please sign in to comment.