mirror of
https://github.com/MCKero6423/fuwari.git
synced 2026-10-02 03:15:35 +00:00
SEO 优化:补全 canonical、og:image、JSON-LD 及页面描述
Layout.astro:
- 新增 <link rel="canonical">,og:url / twitter:url 统一使用规范链接
- 新增 og:image / twitter:image:文章封面为绝对或 public URL 时使用封面,
否则回退站点 favicon-192 并将 twitter:card 从 summary_large_image
降级为 summary,避免声明大图卡片却无图
- banner 判断改用 typeof 收窄,兼容 404 页传入 banner={false} 的情况
posts/[...slug].astro (JSON-LD BlogPosting):
- 新增 dateModified(读取 frontmatter 的 updated 字段)
- 新增 image(仅绝对 URL 封面)和 mainEntityOfPage
- 移除遗留的 TODO 注释
页面 meta description:
- archive / friends / expenses / series 四个页面补充独立描述,
不再退化为用页面标题填充
astro.config.mjs:
- sitemap 增加 filter 排除 /archive/,与 robots.txt 的
Disallow: /archive/ 保持一致,消除收录信号矛盾
This commit is contained in:
1 parent
b35a071c6b
commit
6105577add
7 files changed
+42
-9
No files matched your search
+3
-1
@@ -102,7 +102,9 @@ export default defineConfig({
|
||||
}
|
||||
}),
|
||||
svelte(),
|
||||
sitemap(),
|
||||
sitemap({
|
||||
filter: (page) => !page.includes("/archive/"),
|
||||
}),
|
||||
],
|
||||
markdown: {
|
||||
remarkPlugins: [
|
||||
|
||||
Reference in new issue
Block a user