diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-03-27 00:55:15 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-03-29 15:56:48 +0200 |
| commit | 4d127a038bf768eded68aae3cfa5c1b12241bdac (patch) | |
| tree | 16bbb801caf6770546cff4fdb37b6408ec9ead98 /apps/web/content-collections.ts | |
| parent | 82817cb50cb0487350573d6129130aec705f924b (diff) | |
| download | opencut-4d127a038bf768eded68aae3cfa5c1b12241bdac.tar.gz | |
chore: normalize line endings
Diffstat (limited to 'apps/web/content-collections.ts')
| -rw-r--r-- | apps/web/content-collections.ts | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/apps/web/content-collections.ts b/apps/web/content-collections.ts index a3455d80..b9904bf6 100644 --- a/apps/web/content-collections.ts +++ b/apps/web/content-collections.ts @@ -1,33 +1,33 @@ -import { defineCollection, defineConfig } from "@content-collections/core"; -import { z } from "zod"; - -const changelog = defineCollection({ - name: "changelog", - directory: "content/changelog", - include: "*.md", - schema: z.object({ - content: z.string(), - version: z.string(), - date: z.string(), - title: z.string(), - description: z.string().optional(), - changes: z.array( - z.object({ - type: z.string(), - text: z.string(), - }), - ), - }), - transform: async (doc, { collection }) => { - const allDocs = await collection.documents(); - const sorted = [...allDocs].sort((a, b) => - b.version.localeCompare(a.version, undefined, { numeric: true }), - ); - const isLatest = sorted[0]?.version === doc.version; - return { ...doc, isLatest }; - }, -}); - -export default defineConfig({ - content: [changelog], -}); +import { defineCollection, defineConfig } from "@content-collections/core";
+import { z } from "zod";
+
+const changelog = defineCollection({
+ name: "changelog",
+ directory: "content/changelog",
+ include: "*.md",
+ schema: z.object({
+ content: z.string(),
+ version: z.string(),
+ date: z.string(),
+ title: z.string(),
+ description: z.string().optional(),
+ changes: z.array(
+ z.object({
+ type: z.string(),
+ text: z.string(),
+ }),
+ ),
+ }),
+ transform: async (doc, { collection }) => {
+ const allDocs = await collection.documents();
+ const sorted = [...allDocs].sort((a, b) =>
+ b.version.localeCompare(a.version, undefined, { numeric: true }),
+ );
+ const isLatest = sorted[0]?.version === doc.version;
+ return { ...doc, isLatest };
+ },
+});
+
+export default defineConfig({
+ content: [changelog],
+});
|
