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
  • 6,933
  • 3
  • 26
  • 51
Kelvin Zhao
  • 1,941
  • 2
  • 18
  • 30

1 Answers1

0

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
  • 6,933
  • 3
  • 26
  • 51