feat: expand content types in Card, EditPost, Pagination, and PostDetails components
This commit is contained in:
@@ -6,7 +6,7 @@ import Datetime from "./Datetime.astro";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
variant?: "h2" | "h3";
|
variant?: "h2" | "h3";
|
||||||
} & CollectionEntry<"blog">;
|
} & CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">;
|
||||||
|
|
||||||
const { variant: Heading = "h2", id, data, filePath } = Astro.props;
|
const { variant: Heading = "h2", id, data, filePath } = Astro.props;
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import IconEdit from "@/assets/icons/IconEdit.svg";
|
|||||||
import { SITE } from "@/config";
|
import { SITE } from "@/config";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
hideEditPost?: CollectionEntry<"blog">["data"]["hideEditPost"];
|
hideEditPost?: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">["data"]["hideEditPost"];
|
||||||
class?: string;
|
class?: string;
|
||||||
post: CollectionEntry<"blog">;
|
post: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">;
|
||||||
};
|
};
|
||||||
|
|
||||||
const { hideEditPost, post, class: className = "" } = Astro.props;
|
const { hideEditPost, post, class: className = "" } = Astro.props;
|
||||||
|
|||||||
@@ -72,13 +72,23 @@ const isActive = (path: string) => {
|
|||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<li class="col-span-2">
|
<li class="col-span-2">
|
||||||
<a href="/posts" class:list={{ "active-nav": isActive("/posts") }}>
|
<a href="/events" class:list={{ "active-nav": isActive("/events") }}>
|
||||||
Posts
|
Events
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="col-span-2">
|
<li class="col-span-2">
|
||||||
<a href="/tags" class:list={{ "active-nav": isActive("/tags") }}>
|
<a href="/workshops" class:list={{ "active-nav": isActive("/workshops") }}>
|
||||||
Tags
|
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>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="col-span-2">
|
<li class="col-span-2">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import IconArrowRight from "@/assets/icons/IconArrowRight.svg";
|
|||||||
import LinkButton from "./LinkButton.astro";
|
import LinkButton from "./LinkButton.astro";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
page: Page<CollectionEntry<"blog">>;
|
page: Page<CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const { page } = Astro.props;
|
const { page } = Astro.props;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import IconChevronRight from "@/assets/icons/IconChevronRight.svg";
|
|||||||
import { SITE } from "@/config";
|
import { SITE } from "@/config";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
post: CollectionEntry<"blog">;
|
post: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">;
|
||||||
posts: CollectionEntry<"blog">[];
|
posts: CollectionEntry<"blog" | "events" | "workshops" | "news" | "technical">[];
|
||||||
};
|
};
|
||||||
|
|
||||||
const { post, posts } = Astro.props;
|
const { post, posts } = Astro.props;
|
||||||
|
|||||||
Reference in New Issue
Block a user