File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11---
22import { defaultLang , languages } from " ../i18n/ui" ;
3- import { getEntry } from " astro:content" ;
3+ import { getCollection , getEntry } from " astro:content" ;
44import {
55 getLangFromUrl ,
66 useTranslatedPath ,
@@ -22,12 +22,12 @@ let post = null;
2222const translatedPostSlugs: Partial <typeof languages > = {};
2323
2424try {
25- post = await getEntry (" posts" , postSlug );
25+ post = await getEntry (" posts" , postSlug . replace ( / \/ + $ / , " " ) );
2626 post ! .data .translatedPosts ?.forEach ((tp ) => {
2727 const [language, slug] = tp .translatedPost .slug .split (" /" );
2828 translatedPostSlugs [language as keyof typeof languages ] = slug ;
2929 });
30- } catch {
30+ } catch ( e ) {
3131 post = null ;
3232}
3333---
You can’t perform that action at this time.
0 commit comments