修复 JSON-LD 结构化数据未输出的问题

文章页通过 <script slot="head"> 注入 JSON-LD,经 MainGridLayout 的
<slot slot="head" name="head"> 转发给 Layout,但 Layout 的 <head> 中
从未定义 <slot name="head"> 接收点,导致内容被静默丢弃,
线上文章页始终没有 BlogPosting 结构化数据(Rich Results Test 检测不到)。

在 Layout.astro 的 <head> 中补充 <slot name="head"></slot>。
This commit is contained in:
mckero committed 2026-07-26 08:05:51 +00:00
1 parent 6105577add
commit 77f401cd00
1 file changed
+1
+1
View File
@@ -119,6 +119,7 @@ const bannerOffset =
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<slot name="head"></slot>
{favicons.map(favicon => (
<link rel="icon"
href={favicon.src.startsWith('/') ? url(favicon.src) : favicon.src}