0

I've seen that in the VitePress .md files you can add meta description and keywords like this,

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

But I can't seem to figure out how to add og:title or og:image, it seems that the : throws an error when compiling.

brc-dd
  • 10,788
  • 3
  • 47
  • 67
Kelvin Zhao
  • 2,243
  • 3
  • 22
  • 31

1 Answers1

1

Refer:


So you basically need to do:

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

Moreover, VitePress supports setting the frontmatter in JSON too. So this should also work:

{ "head": [["meta", { "name": "og:title", "content": "Foo Bar" }]] }
brc-dd
  • 10,788
  • 3
  • 47
  • 67