sidebar |
---|
auto |
::: tip TIP We strongly recommend that you read the Getting Started section before using this plugin. :::
::: warning WARN
Note that if you're accessing $pagination
at a route which doesn't match any classification, the value of
$pagination
will be null
.
So when you develop layout components, you need to verify that $pagination
exists.
:::
Matched pages for current route. example:
[
{ "relativePath": "b.md", "path": "/b.html" ... },
{ "relativePath": "a.md", "path": "/a.html" ... },
]
Length of current paginations.
Whether previous pagination page exists.
Link of previous pagination page.
Whether next pagination page exists.
Link of next pagination page.
Get specific pagination page via page number.
::: tip TIP
You can use this function to custom the pagination component as the internal
<Pagnination />
component.
:::
if you create a Frontmatter Classifier as follows:
module.exports = {
plugins: [
[
'@vuepress/blog',
{
frontmatters: [
{
// Unique ID of current classification
id: 'tag',
// Decide that the frontmatter keys will be grouped under this classification
keys: ['tag'],
// Path of the `entry page` (or `list page`)
path: '/tag/',
// Layout of the `entry page`
layout: 'Tag',
},
],
},
],
],
}
Then this plugin will inject a $frontmatterKey
object to the prototype of Vue, so you can use it directly at your
layout component (<Tag />
).
Get the list of matched frontmatter classifier types.
The interface is as follows:
type FrontmatterKeyList = Array<{
name: string;
path: string;
pages: Array<VuePressPage>;
}>
You can re-read the Frontmatter Classifier to see the live
example of tag
.
::: tip Multiple Frontmatter Classifiers
If you create two frontmatter classifiers, e.g. tag
and category
, then in /tag/
route, the $frontmatterKey
will
automatically point to tag
, while in /category/
, it will point to category
.
This variable is essentially designed to generalize the list page of frontmatter keys
:::
Whether comment is enabled.
Get the comment service
Whether email (newsletter) service is enabled.