Skip to content

docs: Added line how to add frontmatter in .vue files #2340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/docs/docs/guide/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ Between these triple-dashed lines, you can set predefined variables (see [below]
frontmatter variables are **optional** in VuePress.
:::

If you want to add frontmatter variables to a Vue component, you can put them into a custom block like this:

```vue
<frontmatter>
title: Blogging Like a Hacker
lang: en-US
</frontmatter>

<template>
...
```

## Alternative frontmatter Formats

VuePress also supports JSON or [TOML](https://github.com/toml-lang/toml) frontmatter.
Expand Down