--- import type { CollectionEntry } from "astro:content"; import { render } from "astro:content"; import { Icon } from "astro-icon/components"; import CoverImage from "@/components/common/CoverImage.astro"; import PostMetadata from "@/components/layout/PostMeta.astro"; import I18nKey from "@/i18n/i18nKey"; import { i18n } from "@/i18n/translation"; import { processCoverImageSync } from "@/utils/image-utils"; import { getFileDirFromPath, getTagUrl } from "@/utils/url-utils"; interface Props { class?: string; entry: CollectionEntry<"posts">; title: string; url: string; published: Date; updated?: Date; tags: string[]; category: string | null; image: string; description: string; draft: boolean; pinned?: boolean; style: string; loading?: "lazy" | "eager"; } const { entry, title, url, published, updated, tags, category, image, description, pinned, style, loading = "lazy", } = Astro.props; const className = Astro.props.class; // 处理随机图:如果image为"api",则从配置的API获取随机图 const processedImage = processCoverImageSync(image, entry.id); const hasCover = processedImage !== undefined && processedImage !== null && processedImage !== ""; const coverWidth = "30%"; const { remarkPluginFrontmatter } = await render(entry); ---