--- import BaseLayout from './BaseLayout.astro'; import CommentSection from '../components/CommentSection.vue'; import LikeButton from '../components/LikeButton.vue'; import type { CollectionEntry } from 'astro:content'; interface Props { post: CollectionEntry<'blog'>; } const { post } = Astro.props; const { title, description, pubDate, updatedDate, heroImage, heroAlt, tags, author, category } = post.data; // 格式化日期 const formatDate = (date: Date) => { return date.toLocaleDateString('zh-CN', { year: 'numeric', month: 'long', day: 'numeric', }); }; // 计算阅读时间(估算) const readingTime = Math.ceil(post.body?.split(/\s+/).length / 400) || 1; ---
{category && ( {category} )} {tags && tags.map((tag: string) => ( #{tag} ))}

{title}

{heroImage && (
{heroAlt
)}