feat: expand content types in Card, EditPost, Pagination, and PostDetails components

This commit is contained in:
vorpax
2026-01-29 11:46:07 +01:00
parent 96d5300d95
commit d953687389
5 changed files with 20 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ import Datetime from "./Datetime.astro";
type Props = {
variant?: "h2" | "h3";
} & CollectionEntry<"blog">;
} & CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">;
const { variant: Heading = "h2", id, data, filePath } = Astro.props;

View File

@@ -4,9 +4,9 @@ import IconEdit from "@/assets/icons/IconEdit.svg";
import { SITE } from "@/config";
type Props = {
hideEditPost?: CollectionEntry<"blog">["data"]["hideEditPost"];
hideEditPost?: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">["data"]["hideEditPost"];
class?: string;
post: CollectionEntry<"blog">;
post: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">;
};
const { hideEditPost, post, class: className = "" } = Astro.props;

View File

@@ -72,13 +72,23 @@ const isActive = (path: string) => {
]}
>
<li class="col-span-2">
<a href="/posts" class:list={{ "active-nav": isActive("/posts") }}>
Posts
<a href="/events" class:list={{ "active-nav": isActive("/events") }}>
Events
</a>
</li>
<li class="col-span-2">
<a href="/tags" class:list={{ "active-nav": isActive("/tags") }}>
Tags
<a href="/workshops" class:list={{ "active-nav": isActive("/workshops") }}>
Workshops
</a>
</li>
<li class="col-span-2">
<a href="/news" class:list={{ "active-nav": isActive("/news") }}>
News
</a>
</li>
<li class="col-span-2">
<a href="/technical" class:list={{ "active-nav": isActive("/technical") }}>
Technical
</a>
</li>
<li class="col-span-2">

View File

@@ -6,7 +6,7 @@ import IconArrowRight from "@/assets/icons/IconArrowRight.svg";
import LinkButton from "./LinkButton.astro";
type Props = {
page: Page<CollectionEntry<"blog">>;
page: Page<CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">>;
};
const { page } = Astro.props;

View File

@@ -16,8 +16,8 @@ import IconChevronRight from "@/assets/icons/IconChevronRight.svg";
import { SITE } from "@/config";
type Props = {
post: CollectionEntry<"blog">;
posts: CollectionEntry<"blog">[];
post: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">;
posts: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">[];
};
const { post, posts } = Astro.props;