@@ -3,37 +3,45 @@ import Layout from '@/layouts/Layout.astro';
33import { type CollectionEntry , getCollection } from ' astro:content' ;
44
55export async function getStaticPaths() {
6- const posts = await getCollection (' posts' , ({ data } ) => {
7- return data .draft !== true ;
6+ const posts = await getCollection (' posts' , (post : CollectionEntry < ' posts ' > ) => {
7+ return post . data .draft !== true ;
88 });
9- return posts .map ((post ) => ({
10- // @ts-expect-error
9+ return posts .map ((post : CollectionEntry <' posts' >) => ({
1110 params: { slug: post .slug },
1211 props: post ,
1312 }));
1413}
1514type Props = CollectionEntry <' posts' >;
1615
1716const post = Astro .props ;
18- // @ts-expect-error
1917const { Content } = await post .render ();
2018---
2119
2220<Layout title ={ post .data .title } description ={ post .data .description } >
23- <main >
24- <article class =" mx-lg-5 m-3" >
21+ <main >
22+ <article class =" mx-lg-5 m-3" >
2523 <div class =" p-2" >
2624 <h1 >{ post .data .title } </h1 >
2725 <time >{ new Date (post .data .pubDate )
28- .toLocaleString (' ar-SA-u-ca-islamic-umalqura' , {
29- weekday: ' long' ,
30- year: ' numeric' ,
31- month: ' long' ,
32- day: ' numeric' ,
33- })} </time >
26+ .toLocaleString (' ar-SA-u-ca-islamic-umalqura' , {
27+ weekday: ' long' ,
28+ year: ' numeric' ,
29+ month: ' long' ,
30+ day: ' numeric' ,
31+ })} </time >
32+
33+ <!-- Author Section -->
34+ <hr class =" author-hr" >
35+ <div class =" author-box" >
36+ <img src =" /images/1x1/avatar.jpg" alt =" حمد بنقالي" class =" author-avatar" >
37+ <div class =" author-text" >
38+ <h6 class =" author-name" >حمد بنقالي</h6 >
39+ <small class =" author-desc" >تقني شغوف بتطوير البرمجيات وتقنيات الويب</small >
40+ </div >
41+ </div >
3442 </div >
3543 <hr >
36- <Content />
37- </article >
38- </main >
44+ <Content />
45+ </article >
46+ </main >
3947</Layout >
0 commit comments