aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/content
diff options
context:
space:
mode:
authorPauline <git@ethanlibs.co>2024-01-22 04:27:34 +0100
committerPauline <git@ethanlibs.co>2024-01-22 04:27:48 +0100
commitf0e73cf90005709e20b2f16f63d67d6802af3332 (patch)
tree1fb33d1bf14ada662a9cbdea1728c3f031c06ff0 /apps/website/src/content
parente1f6521a78f5c2a873199fd8cded0bc58ac3aa6e (diff)
downloadNexus-f0e73cf90005709e20b2f16f63d67d6802af3332.tar.gz
Nexus-f0e73cf90005709e20b2f16f63d67d6802af3332.tar.bz2
Nexus-f0e73cf90005709e20b2f16f63d67d6802af3332.zip
feat(layout): add seo metadata to all pages
Diffstat (limited to 'apps/website/src/content')
-rw-r--r--apps/website/src/content/blog/first.md2
-rw-r--r--apps/website/src/content/config.ts11
2 files changed, 8 insertions, 5 deletions
diff --git a/apps/website/src/content/blog/first.md b/apps/website/src/content/blog/first.md
index 3066715..2b5f64a 100644
--- a/apps/website/src/content/blog/first.md
+++ b/apps/website/src/content/blog/first.md
@@ -1,7 +1,7 @@
---
title: 'First post'
description: 'Lorem ipsum dolor sit amet'
-pubDate: 'Jul 08 2022'
+publishDate: 'Jul 08 2022'
heroImage: '/blog-placeholder-3.jpg'
---
diff --git a/apps/website/src/content/config.ts b/apps/website/src/content/config.ts
index 8d68c0e..6f6cde9 100644
--- a/apps/website/src/content/config.ts
+++ b/apps/website/src/content/config.ts
@@ -1,12 +1,15 @@
-import { defineCollection, z } from 'astro:content';
+import { defineCollection } from 'astro:content';
+import { z } from 'zod';
const blog = defineCollection({
schema: z.object({
title: z.string(),
description: z.string(),
- pubDate: z.coerce.date(),
- updatedDate: z.coerce.date().optional(),
- heroImage: z.string().optional(),
+ publishDate: z.string().or(z.date()).transform(val => new Date(val)),
+ updatedDate: z.string().or(z.date()).transform(val => new Date(val)).optional(),
+ socialImage: z.string().optional(),
+ coverImage: z.string().optional(),
+ lang: z.enum(['en']).default('en'),
}),
});