--- interface Props { url: string; showArchive?: boolean; title?: string; description?: string; siteName?: string; } const { url, showArchive = true} = Astro.props; const siteMetadata = { title: Astro.props.title || '', description: Astro.props.description || '', siteName: Astro.props.siteName || '', image: '', domain: new URL(url).hostname || '' }; // 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(/