diff --git a/src/pages/categories/[slug].astro b/src/pages/categories/[slug].astro index 42a5f08..dc1a864 100644 --- a/src/pages/categories/[slug].astro +++ b/src/pages/categories/[slug].astro @@ -10,8 +10,8 @@ const { slug } = Astro.params; const { posts } = ( await graphQuery( - `query Query($where: PostWhereInput!) { - posts(where: $where) { + `query Query($where: PostWhereInput!, $orderBy: [PostOrderByInput!]!) { + posts(where: $where, orderBy: $orderBy) { slug type title @@ -33,7 +33,14 @@ const { posts } = ( createdAt } }`, - { where: { categories: { some: { slug: { equals: slug } } } } } + { + orderBy: [ + { + createdAt: "desc", + }, + ], + where: { categories: { some: { slug: { equals: slug } } } }, + } ) ).data; --- diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro index 194d6a5..ec35470 100644 --- a/src/pages/posts/[slug].astro +++ b/src/pages/posts/[slug].astro @@ -13,8 +13,8 @@ const { slug } = Astro.params; const { post } = ( await graphQuery( - `query Query($where: PostWhereUniqueInput!) { - post(where: $where) { + `query Query($where: PostWhereInput!, $orderBy: [PostOrderByInput!]!) { + posts(where: $where, orderBy: $orderBy) { slug type title @@ -43,7 +43,14 @@ const { post } = ( createdAt } }`, - { where: { slug } } + { + orderBy: [ + { + createdAt: "desc", + }, + ], + where: { slug }, + } ) ).data; --- diff --git a/src/pages/projects/index.astro b/src/pages/projects/index.astro new file mode 100644 index 0000000..f607519 --- /dev/null +++ b/src/pages/projects/index.astro @@ -0,0 +1,24 @@ +--- +import PageLayout from "../../layouts/PageLayout.astro"; +--- + + + + diff --git a/src/pages/tags/[slug].astro b/src/pages/tags/[slug].astro index 0df711e..bc55cd3 100644 --- a/src/pages/tags/[slug].astro +++ b/src/pages/tags/[slug].astro @@ -10,8 +10,8 @@ const { slug } = Astro.params; const { posts } = ( await graphQuery( - `query Query($where: PostWhereInput!) { - posts(where: $where) { + `query Query($where: PostWhereInput!, $orderBy: [PostOrderByInput!]!) { + posts(where: $where, orderBy: $orderBy) { slug type title @@ -33,7 +33,14 @@ const { posts } = ( createdAt } }`, - { where: { tags: { some: { slug: { equals: slug } } } } } + { + orderBy: [ + { + createdAt: "desc", + }, + ], + where: { tags: { some: { slug: { equals: slug } } } }, + } ) ).data; ---