Skip to content

Commit b5e562a

Browse files
committed
fix: Correct trailing / on content requests
1 parent 09593e7 commit b5e562a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function getContent([lang, name]) {
1313
let path = `/content/${lang}`,
1414
url = `${path}/${name.replace(/^\//, '')}`,
1515
ext = (url.match(/\.([a-z]+)$/i) || [])[1];
16-
if (!ext) url += '.md';
16+
if (!ext) url = url.endsWith('/') ? url.replace(/\/$/, '.md') : url + '.md';
1717

1818
let fallback = false;
1919
return await fetch(url)

0 commit comments

Comments
 (0)