0

我已经看到在 VitePress.md文件中,您可以像这样添加元描述和关键字,

head:
  - - meta
    - name: description
      content: my custom description

但我似乎无法弄清楚如何添加og:titleor og:image,编译时似乎会:引发错误。

4

1 回答 1

0

参考:


所以你基本上需要做:

head:
  - - meta
    - name: 'og:title'
      content: Foo Bar

此外,VitePress 也支持在 JSON 中设置 frontmatter。所以这也应该有效:

{ "head": [["meta", { "name": "og:title", "content": "Foo Bar" }]] }
于 2022-01-06T05:17:50.197 回答