Order articles by date DESC

This commit is contained in:
Riyyi
2025-04-05 14:59:59 +02:00
parent 2c58f39f07
commit 551478d15a
8 changed files with 76 additions and 35 deletions
+13 -7
View File
@@ -1,13 +1,19 @@
import { defineContentConfig, defineCollection } from '@nuxt/content'
import { defineContentConfig, defineCollection, z } from '@nuxt/content'
// Lookup resolved from path: rootDir/content
// see: https://github.com/nuxt/content/issues/3161
export default defineContentConfig({
collections: {
content: defineCollection({
type: "page",
source: "**/*.md"
})
}
collections: {
content: defineCollection({
type: "page",
source: "**/*.md",
schema: z.object({
date: z.date(),
img: z.string(),
sub: z.string(),
tags: z.array(z.string()),
})
})
}
})