--- import type { CollectionEntry } from 'astro:content' import PinIcon from '@/assets/icons/pin-icon.svg' import PostDate from '@/components/PostDate.astro' import { defaultLocale } from '@/config' import { generateDescription } from '@/utils/description' import { isHomePage } from '@/utils/page' type Post = CollectionEntry<'posts'> & { remarkPluginFrontmatter: { minutes: number } } const { posts, lang, pinned = false } = Astro.props const isHome = isHomePage(Astro.url.pathname) export interface Props { posts: Post[] lang?: string pinned?: boolean } function getPostPath(post: Post) { // Prioritize abbrlink over slug const postPath = post.data.abbrlink || post.id // 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}/` } ---