diff --git a/src/lib/types.ts b/src/lib/types.ts index 88f7db4..4f5ee74 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -1,8 +1,6 @@ import type { CollectionEntry } from "astro:content"; import type { MarkdownHeading } from "astro"; -import { type LucideIcon } from "lucide-react"; - // For HeadSEO.astro export interface HeadSEOProps { title?: string | undefined; diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index b84cfa8..d2b9d70 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -4,12 +4,17 @@ import type { GetStaticPaths, MarkdownHeading } from "astro"; import DocsLayout from "@/layouts/DocsLayout.astro"; -import type { Heading } from "@/lib/types"; +import type { Heading, DocsData, DocsEntry } from "@/lib/types"; export const getStaticPaths = (async () => { - const docs = await getCollection("docs", ({ data }) => !data.draft); + const docs: DocsEntry[] = await getCollection( + "docs", + (data: DocsEntry) => !data.data.draft + ); const headings: MarkdownHeading[][] = await Promise.all( - docs.map((entry) => entry.render().then((data) => data.headings)) + docs.map((entry) => + entry.render().then((data: { headings: any }) => data.headings) + ) ); const posts = docs.map((entry, index) => {