> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 动态 OG 图片  \[#dynamic-og-images]

Fern 现在可以自动为您文档站点的每个页面生成唯一的 Open Graph 图片。在您的 `docs.yml` 元数据中设置 `og:dynamic` 为 true 来启用此功能。在前置配置中设置了 `og:image` 的页面将使用指定的图片。

您还可以使用 `og:background-image` 为动态生成的 OG 图片设置自定义背景图片，而不是纯色背景。

**`docs.yml`**

```yaml docs.yml
metadata:
  og:dynamic: true
  og:background-image: ./images/og-background.png # 可选
```

阅读文档