Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HYP3R00T committed Sep 17, 2024
1 parent a271417 commit 822bc1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
11 changes: 8 additions & 3 deletions src/pages/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 822bc1b

Please sign in to comment.