11---
22import BaseLayout from " ./Common.astro" ;
3+ import { getBlogPosts } from " ../content/config" ;
34import { type CollectionEntry } from " astro:content" ;
45
56type Props = CollectionEntry <" blog" >[" data" ];
@@ -10,8 +11,7 @@ import { getLangFromUrl, useTranslations } from "../i18n/utils";
1011const currentLang = getLangFromUrl (Astro .url );
1112const t = useTranslations (currentLang );
1213
13- import { getCollection } from " astro:content" ;
14- const blogEntries = (await getCollection (" blog" ))
14+ const blogEntries = (await getBlogPosts ())
1515 .filter (function (blogEntry ) {
1616 return blogEntry .data .tags .some ((element : any ) => {
1717 return tags .indexOf (element ) !== - 1 ;
@@ -111,7 +111,7 @@ const blogEntries = (await getCollection("blog"))
111111 blogEntries .map ((post ) => (
112112 <article class = " lb-blog__item blog-img-zoom" >
113113 <div class = " thumb" >
114- <a href = { ` ${ post .slug . split ( " / " )[ 1 ] }` } >
114+ <a href = { ` /${ lang }/blog/${ post .blog_slug }` } >
115115 <img src = { post .data .image } />
116116 </a >
117117 </div >
@@ -126,7 +126,7 @@ const blogEntries = (await getCollection("blog"))
126126 </span >
127127 </li >
128128 </ul >
129- <a href = " blog-details.html " >
129+ <a href = { ` /${ lang }/ blog/${ post . blog_slug } ` } >
130130 <h3 class = " lb-blog__title" >{ post .data .title } </h3 >
131131 </a >
132132 </article >
0 commit comments