mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-24 03:01:30 +08:00
feat: show counts
This commit is contained in:
@ -6,9 +6,10 @@ import GiscusComment from "@/components/componentsBefore/GiscusComment";
|
||||
type Props<Tag extends HTMLTag> = Polymorphic<{ as: Tag }> & {
|
||||
note: CollectionEntry<"note">;
|
||||
isPreview?: boolean | undefined;
|
||||
index?: number;
|
||||
};
|
||||
|
||||
const { as: Tag = "div", note, isPreview = false } = Astro.props;
|
||||
const { as: Tag = "div", note, isPreview = false, index } = Astro.props;
|
||||
const { Content } = await render(note);
|
||||
const dateTimeOptions: Intl.DateTimeFormatOptions = note.data.date_created
|
||||
? {
|
||||
@ -37,9 +38,12 @@ const date = note.data.date_created ?? note.data.date;
|
||||
<Tag class="title" class:list={{ "text-base": isPreview }}>
|
||||
{
|
||||
isPreview ? (
|
||||
<a class="cactus-link" href={`/notes/${note.id}/`}>
|
||||
{note.data.title}
|
||||
</a>
|
||||
<>
|
||||
{index + 1}.{" "}
|
||||
<a class="cactus-link" href={`/notes/${note.id}/`}>
|
||||
{note.data.title}
|
||||
</a>
|
||||
</>
|
||||
) : (
|
||||
<>{note.data.title}</>
|
||||
)
|
||||
|
Reference in New Issue
Block a user