--- import { ClientRouter } from 'astro:transitions'; import CompareTray from '@/components/CompareTray.astro'; import '../styles/global.css'; interface Props { title?: string; description?: string; /** OG 图路径,默认站点通用图;详情页传设备 slug */ ogImage?: string; /** 用于 og:url 与 canonical 的路径,默认取当前路径 */ path?: string; } const { title = 'LFSpecs', description = '公开硬件规格库:收录手机、芯片等设备的详细参数,支持横向对比。', ogImage, path, } = Astro.props; const site = Astro.site ?? new URL('https://specs.atie.fun'); const canonical = new URL(path ?? Astro.url.pathname, site).href; const image = new URL(ogImage ?? '/og/site.png', site).href; const ogType = path?.startsWith('/devices/') ? 'article' : 'website'; ---