Global Computed

In VuePress, some core computedGlobal Computed - 图1 properties are built-in for use by default theme or custom themes.

$site

This is the $site value of the site you see now:

  1. {
  2. "title": "VuePress",
  3. "description": "Vue-powered static site generator",
  4. "base": "/",
  5. "pages": [
  6. {
  7. "lastUpdated": 1524027677000,
  8. "path": "/",
  9. "title": "VuePress",
  10. "frontmatter": {}
  11. },
  12. ...
  13. ]
  14. }

$page

This is the $page value of the page you see now:

  1. {
  2. "title": "Global Computed",
  3. "frontmatter": {},
  4. "regularPath": "/guide/global-computed.html",
  5. "key": "v-d4cbeb69eff3d",
  6. "path": "/guide/global-computed.html",
  7. "headers": [
  8. {
  9. "level": 2,
  10. "title": "$site",
  11. "slug": "site"
  12. },
  13. {
  14. "level": 2,
  15. "title": "$page",
  16. "slug": "$page"
  17. },
  18. ...
  19. ]
  20. }

$frontmatter

Reference of $page.frontmatter.

$lang

The language of the current page, the default value is en-US.

Also see:

$localePath

The locale path prefix for the current page, the default value is /.

Also see:

$title

Value of the <title> label used for the current page.

$description

The content value of the <meta name= "description" content= "…"> for the current page.

$themeConfig

That is siteConfig.themeConfig