For AI agents: a documentation index is available at /llms.txt. Markdown versions of these pages are available by appending `.md` to the URL or by sending `Accept: text/markdown`.

规则 / og-image-relative-url · 规则集 2026-07

og:image 使用相对路径

错误og-image-relative-url

名称

og:image 使用相对路径 og-image-relative-url

社交抓取器解析相对图片 URL 的方式不一致,很多会直接丢弃图片。

如何修复

使用包含协议和主机的绝对 URL,例如 https://cdn.example.com/og.jpg。

修复示例:

<meta property="og:image" content="https://cdn.example.com/og/share.jpg" />

复制或下载

可复制的 Markdown,方便发给同事或贴进 agent 对话。

# og-image-relative-url — og:image 使用相对路径

- **名称:** og:image 使用相对路径

## 说明

社交抓取器解析相对图片 URL 的方式不一致,很多会直接丢弃图片。

## 如何修复

使用包含协议和主机的绝对 URL,例如 https://cdn.example.com/og.jpg。

### 修复示例:

```html
<meta property="og:image" content="https://cdn.example.com/og/share.jpg" />
```

## 规则文档

https://ogkit.akr.moe/zh/rules/og-image-relative-url

下载这条规则的 Agent Skill 包。

下载 og-image-relative-url.skill

文件是 skill-name/SKILL.md 的 ZIP(Agent Skills 规范)。.skill 就是这份 ZIP;如果客户端只要 .zip,改个扩展名即可。

规则 IDog-image-relative-url
严重程度错误
分类图片
平台全部平台
需要人工处理否

这是什么

og:image 使用相对路径。OGKit 规则 og-image-relative-url(错误)。该 ID 是文档网址与 CI --disable 键使用的公开 API,请勿改名。

以下搜索词应指向本页:

  • All URLs must be absolute
  • I want my og:url or og:image tags to use relative URLs, but the debugger complains about this.
  • og:image is a relative path
  • relative og:image
  • og:image relative URL

为什么重要

社交抓取器解析相对图片 URL 的方式不一致,很多会直接丢弃图片。

受影响的平台

全部 OGKit 平台资料,包括使用这些标签的主要社交、聊天与搜索爬虫。

各平台的爬虫预算与字段优先级详见平台行为参考。

如何复现

  1. Read og:image content. If it starts with `/` or lacks a scheme, this fires.
  2. Example bad value: `/images/share.jpg`
OGKit