--- import Layout from '@/layouts/Layout.astro' import { getPinnedPosts, getPostsByYear } from '@/utils/content' const pinnedPosts = await getPinnedPosts() const postsByYear = await getPostsByYear() ---
{pinnedPosts.length > 0 && (
)} {[...postsByYear.entries()].map(([_year, posts]) => ( // Year Group
{/* Decorative Line */}
{/* Posts List */}
    {posts.map(post => ( // Single Post
  • {/* Post Title */} {post.data.title} {/* Post Date */}
    {post.data.published.toLocaleDateString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')} {post.remarkPluginFrontmatter?.minutes} min
  • ))}
))}