--- import type { PostEntry } from '@/lib/content'; import { getPostCardImage, getPostPath, getPostTaxonomy } from '@/lib/content'; import { siteConfig } from '@/site.config'; interface Props { post: PostEntry; } const { post } = Astro.props; const postPath = getPostPath(post); const taxonomy = getPostTaxonomy(post); const categories = taxonomy.categories.join(', '); const date = [post.data.pubDate.getFullYear(), post.data.pubDate.getMonth() + 1, post.data.pubDate.getDate()] .map((part, index) => index === 0 ? String(part) : String(part).padStart(2, '0')) .join('-'); const image = getPostCardImage(post, siteConfig.cards.defaultCovers, siteConfig.site.url); --- {image && } {post.data.title} {date}{categories && <> ยท {categories}>}
{date}{categories && <> ยท {categories}>}