Skip to content

Commit e11723a

Browse files
committed
Fix static CDN images
1 parent 6b8642e commit e11723a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mdx/static-images.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const rehypeStaticImages: Plugin<[], Root, Root> =
2020
) {
2121
if (!node.properties.src.startsWith("http")) {
2222
let url = node.properties.src;
23-
const relativePath = url.startsWith("/public/")
24-
? `/docs${url.substring("/public".length)}`
23+
const relativePath = url.startsWith("/")
24+
? `/docs/${url.replace(/^\//, "")}`
2525
: url;
2626
if (process.env.USE_IMAGE_CDN) {
2727
node.properties.src = `https://cdn.zuplo.com${relativePath}`;

0 commit comments

Comments
 (0)