From b649d3585d345e6f2835344a9b13fdc2b6553575 Mon Sep 17 00:00:00 2001 From: x7md Date: Sun, 26 May 2024 17:23:40 +0300 Subject: [PATCH] complete posts list page --- src/pages/about.astro | 1 - src/pages/index.astro | 11 ++++++-- src/pages/posts/index.astro | 50 +++++++++++++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/pages/about.astro b/src/pages/about.astro index f936e73..feeacff 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -1,6 +1,5 @@ --- import Layout from '@/layouts/Layout.astro'; -import Card from '@/components/Card.astro'; import { profilePage } from '@/schema.blog'; --- diff --git a/src/pages/index.astro b/src/pages/index.astro index 34f4a61..823e753 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,5 @@ --- import Layout from '@/layouts/Layout.astro'; -import Card from '@/components/Card.astro'; import { blog } from '@/schema.blog'; import { getCollection } from 'astro:content'; @@ -33,7 +32,15 @@ const posts = await getCollection('posts', ({ data }) => {

{post.data.title}

- +
diff --git a/src/pages/posts/index.astro b/src/pages/posts/index.astro index 0c998d2..0abadf9 100644 --- a/src/pages/posts/index.astro +++ b/src/pages/posts/index.astro @@ -1,6 +1,5 @@ --- import Layout from '@/layouts/Layout.astro'; -import Card from '@/components/Card.astro'; import { blog } from '@/schema.blog'; import { getCollection } from 'astro:content'; @@ -12,8 +11,55 @@ const posts = await getCollection('posts', ({ data }) => {
-

التدوينات

+
+

التدوينات

+
+
+
    + { + posts.sort( + (a, b) => Date.parse(a.data.pubDate.valueOf()) - Date.parse(b.data.pubDate.valueOf()) + ).reverse().map((post) => { + return ( +
  1. + +
    +

    {post.data.title}

    + +
    +
    +
  2. + ); + }) + } +
+
+