--- import type { CollectionEntry } from 'astro:content' import PostDate from '@/components/PostDate.astro' import { defaultLocale } from '@/config' import { generateDescription } from '@/utils/description' import { isTagPage } from '@/utils/page' type Post = CollectionEntry<'posts'> & { remarkPluginFrontmatter: { minutes: number } } const { posts, lang } = Astro.props const isTag = isTagPage(Astro.url.pathname) export interface Props { posts: Post[] lang?: string } function getPostPath(post: Post) { // Prioritize abbrlink over slug const postPath = post.data.abbrlink || post.slug // Add language prefix to URL if current page is in a language subdirectory and not the default language return lang && lang !== defaultLocale ? `/${lang}/posts/${postPath}/` : `/posts/${postPath}/` } ---