# Config

TIP

We strongly recommend that you read the Getting Started section before using this plugin.

# directories

  • Type: DirectoryClassifier[]
  • Default: []

Create one or more directory classifiers, all available options in DirectoryClassifier are as follows.

# id

  • Type: string
  • Default: undefined
  • Required: true

Unique id for current classifier, e.g. post.

# dirname

  • Type: string
  • Default: undefined
  • Required: true

Matched directory name, e.g. _post.

# path

  • Type: string
  • Default: /${id}/
  • Required: false

Entry page for current classifier, e.g. / or /post/.

If you set DirectoryClassifier.path to /, it means that you want to access the matched pages list at /. set to /post/ is the same.

# layout

  • Type: string
  • Default: 'IndexPost' || 'Layout'
  • Required: false

Layout component name for entry page.

# frontmatter

  • Type: Record<string, any>
  • Default: {}
  • Required: false

Frontmatter for entry page.

# itemLayout

  • Type: string
  • Default: 'Post'
  • Required: false

Layout for matched pages.

  • Type: string
  • Default: '/:year/:month/:day/:slug'
  • Required: false

Permalink for matched pages.

For example, if you set up a directory classifier with dirname equals to _post, and have following pages:

.
└── _posts
    ├── 2018-4-4-intro-to-vuepress.md
    └── 2019-6-8-intro-to-vuepress-next.md

With the default itemPermalink, you'll get following output paths:

/2018/04/04/intro-to-vuepress/
/2019/06/08/intro-to-vuepress-next/

For more details about permalinks, please head to Permalinks section at VuePress's documentation.

# pagination

  • Type: Pagination
  • Required: false

It can overwrite globalPagination.

Please head to Pagination Config section to get all available options.

# frontmatters

# id

  • Type: string
  • Default: undefined
  • Required: true

Unique id for current classifier, e.g. tag.

# keys

  • Type: string
  • Default: undefined
  • Required: true

Frontmatter keys used to classify pages.

You can also merge multiple tags with the same meaning, e.g.

module.exports = {
  plugins: [
    ['@vuepress/plugin-blog', {
      frontmatters: [
        {
          id: "tag",
          keys: ['tag', 'tags'],
        },
      ]
    }],
  ],
}

# path

  • Type: string
  • Default: /${id}/
  • Required: false

Entry page for current classifier, e.g. / or /post/.

# layout

  • Type: string
  • Default: 'IndexPost' || 'Layout'
  • Required: false

Layout component name for entry page.

# scopeLayout

  • Type: string
  • Default: undefined
  • Required: false

Layout component name for scope page.

# frontmatter

  • Type: Record<string, any>
  • Default: {}
  • Required: false

Frontmatter for entry page.

# pagination

  • Type: Pagination
  • Required: false

It can overwrite globalPagination.

Please head to Pagination Config section to get all available options.

# globalPagination

Pagination config for all directories and frontmatters.

  • Type: Pagination
  • Required: false

Please head to Pagination Config section to get all available options.

# sitemap

  • Type: object
  • Default: {}
  • Required: false

It will be enabled when hostname is provided. e.g.

{
  hostname: 'https://yourdomain'
}

The 404 page is excluded by default. Further options, please head to vuepress-plugin-sitemap.

# comment

# service

Service to accomplish commenting.

  • Type: 'vssue' | 'disqus';
  • Default: undefined
  • Required: false

# others

Other options depend on which service you pick since this feature is accomplished by the plugins below. All options except service will be passed directly to the plugin, so take a look at their documentation for more details: