--- import { type CollectionEntry, render } from "astro:content"; import FormattedDate from "@/components/FormattedDate.astro"; import type { HTMLTag, Polymorphic } from "astro/types"; import GiscusComment from "@/components/componentsBefore/GiscusComment"; import ArticleContainer from "../ArticleContainer.astro"; import ShareButtons from "../ShareButtons.astro"; type Props = Polymorphic<{ as: Tag }> & { note: CollectionEntry<"note">; isPreview?: boolean | undefined; index?: number; }; const { as: Tag = "div", note, isPreview = false, index } = Astro.props; const { Content } = await render(note); const dateTimeOptions: Intl.DateTimeFormatOptions = note.data.date_created ? { hour: "2-digit", minute: "2-digit", year: "2-digit", month: "2-digit", day: "2-digit", } : { year: "2-digit", month: "2-digit", day: "2-digit", }; const date = note.data.date_created ?? note.data.date; let modifiedDate = note.data?.date_modified; if (modifiedDate && modifiedDate.toDateString() === date.toDateString()) { modifiedDate = undefined; } --- { isPreview ? ( <> {index ? `${index + 1}.` : ""} {note.data.title} ) : ( <>{note.data.title} ) }
{ modifiedDate && ( Updated: ) }
{!isPreview && } { !isPreview && (
) }