Skip to content

[SEO] HtmlPostProcessor 注入的 JSON-LD image 字段应为绝对 URL #136

Description

@Tespera

现状

引擎为文章页自动注入的 BlogPosting JSON-LD 中,image 字段输出的是相对路径:

{
  "@type": "BlogPosting",
  "image": "/post-images/Gridea-pro-wails-enhance.jpg",
  ...
}

(实测于 chatgpt 主题渲染产物 output/post/Gridea-pro-wails-enhance/index.html,2026-07)

问题

schema.org 与 Google 富结果文档均要求结构化数据中的 image完整绝对 URL。相对路径会被部分解析器(含 Google 富结果测试)忽略或判为无效,导致文章富结果丢失配图。

建议

注入时用站点 domain 拼接为绝对 URL(文章 feature 图若本身是外链绝对 URL 则原样保留)。顺带可检查同一注入管线里 og:image / twitter:image 是否也是相对路径(实测同样是 /images/avatar.png 相对形式),OG 协议同样要求绝对 URL。

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions