{entry.data.title}
+ {authorInfo.map((a: any) =>{entry.data.summary}
} +diff --git a/src/components/shortcodes/LinkCard.astro b/src/components/shortcodes/LinkCard.astro index b8097d4..7cdb361 100644 --- a/src/components/shortcodes/LinkCard.astro +++ b/src/components/shortcodes/LinkCard.astro @@ -1,4 +1,6 @@ --- +import { getMetadata, getWaybackMetadata } from '../../plugins/get-metadata'; + interface Props { url: string; showArchive?: boolean; @@ -29,71 +31,12 @@ function formatDateToNumber(date: Date | string | undefined): string { return `${year}${month}${day}`; } -// Get metadata from the URL -async function fetchMetadata(url: string) { - try { - const response = await fetch(url, { - headers: { - 'User-Agent': 'Mozilla/5.0 (compatible; LinkCard/1.0)' - } - }); - - if (!response.ok) { - throw new Error(`HTTP ${response.status}`); - } - - const html = await response.text(); - - // 提取元数据 - const titleMatch = html.match(/
{entry.data.summary}
} -{entry.data.summary}
} +