fix(ci): proper types

This commit is contained in:
Barrett Ruth 2025-11-09 14:53:56 -05:00
parent 28c3cfcf6d
commit 16850cf468
9 changed files with 607 additions and 15 deletions

View file

@ -1,14 +1,19 @@
---
import { getCollection } from "astro:content";
import { getCollection, type CollectionEntry } from "astro:content";
import PostLayout from "../../layouts/PostLayout.astro";
import * as collections from "../../content/config";
import type { PostCollection, AnyCollectionEntry } from "../../types";
export async function getStaticPaths() {
const categories = Object.keys(collections.collections).filter(
(c) => c !== "git" && c !== "gists",
);
) as PostCollection[];
const entries: Array<{
params: { category: string; slug: string };
props: { post: AnyCollectionEntry };
}> = [];
const entries = [];
for (const category of categories) {
const docs = await getCollection(category);
for (const doc of docs) {
@ -21,6 +26,10 @@ export async function getStaticPaths() {
return entries;
}
interface Props {
post: AnyCollectionEntry;
}
const { post } = Astro.props;
const category = Astro.params.category;
const { Content } = await post.render();