Skip to content

Commit 37fac27

Browse files
committed
nuxt: Normalise relative blog image paths to absolute
1 parent 818c259 commit 37fac27

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

nuxt/server/api/blog.get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default defineEventHandler((event) => {
122122
date: p._date,
123123
url: String(p.url),
124124
description: String(p.description || ''),
125-
image: p.image ? String(p.image) : null,
125+
image: p.image ? String(p.image).replace(/^(?!\/)/, '/') : null,
126126
authors: ((p.authors as string[]) || []).map(id => ({ id, name: people[id] || id })),
127127
}))
128128

0 commit comments

Comments
 (0)