From 270b7fa3e4fbfc8ae282afdf6c24d295b8bb1255 Mon Sep 17 00:00:00 2001 From: "aitor c. urrutia aranburu" Date: Sun, 18 Oct 2026 13:56:29 +0200 Subject: [PATCH] chore: tipoak konpontzen ditu --- src/content.config.js | 21 +++++++++++---------- src/pages/post/[slug].astro | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/content.config.js b/src/content.config.js index 7a4e947..4301b71 100644 --- a/src/content.config.js +++ b/src/content.config.js @@ -1,17 +1,18 @@ -import { defineCollection, z } from "astro:content"; +import { defineCollection } from "astro:content"; +import { z } from "astro/zod"; import { glob } from "astro/loaders"; const posts = defineCollection({ - loader: glob({ pattern: "*.md", base: "./posts" }), - schema: z.object({ - title: z.string(), - slug: z.string(), - description: z.string(), - added: z.union([z.string(), z.date()]), - updated: z.union([z.string(), z.date()]).optional(), - tags: z.array(z.string()), - }), + loader: glob({ pattern: "*.md", base: "./posts" }), + schema: z.object({ + title: z.string(), + slug: z.string(), + description: z.string(), + added: z.union([z.string(), z.date()]), + updated: z.union([z.string(), z.date()]).optional(), + tags: z.array(z.string()), + }), }); export const collections = { posts }; diff --git a/src/pages/post/[slug].astro b/src/pages/post/[slug].astro index c877685..ca088d5 100644 --- a/src/pages/post/[slug].astro +++ b/src/pages/post/[slug].astro @@ -1,9 +1,9 @@ --- -import { getCollection, render } from "astro:content"; +import { CollectionEntry, getCollection, render } from "astro:content"; import BlogPost from "../../layouts/BlogPost.astro"; export async function getStaticPaths() { - let posts = await getCollection("posts"); + const posts: CollectionEntry<"posts">[] = await getCollection("posts"); return posts.map((post) => { return {