Blog Plugin Config
Intro
The theme provides blog feature via @vuepress/plugin-blog, and it's not enabled by default.
You can enable blog feature by setting plugins.blog to true in theme options.
For instructions, please see Blog Intro.
Options
plugins.blog.excerpt
- Type:
boolean - Default:
true
Whether generate excerpt for page.
plugins.blog.excerptSeparator
- Type:
string - Default:
<!-- more -->
Separator used to split excerpt from page content.
plugins.blog.excerptLength
- Type:
number - Default:
300
Length of excerpt when auto generating.
plugins.blog.filter
Type:
(page: Page) => booleanDefault:
({ frontmatter, filePathRelative }) => frontmatter.article ?? (Boolean(filePathRelative) && !frontmatter.home);
Page filter, determine whether a page should be included.
By default, all the pages generated from Markdown files but not homepage will be included as articles.
plugins.blog.excerptFilter
- Type:
(page: Page) => boolean - Default:
filteroption
Page filter, determine whether the plugin should generate excerpt for it.
plugins.blog.slugify
- Type:
(name: string) => string - Default:
(name) => name.replace(/ _/g, '-').replace(/[:?*|\\/<>]/g, "").toLowerCase()
Slugify function, used to convert key name which they are register in routes.
plugins.blog.type
Type:
BlogTypeOptions[]import type {Page} from "vuepress"; interface BlogTypeOptions { /** * Unique type name */key: string; /** * A filter function to determine whether a page should be the type */filter: (page:Page) => boolean; /** * A custom function to sort the pages */sorter?: (pageA:Page,pageB:Page) => number; /** * Page path to be registered * * @default '/:key/' */path?: string; /** * Frontmatter */frontmatter?: (localePath: string) =>Record<string, string>; /** * Layout name * * @default 'Blog' */layout?: string; }Default:
[]Details:
Additional article type.
plugins.blog.article
- Type:
string - Default:
/article/
Article list route path.
plugins.blog.category
- Type:
string - Default:
/category/
Category map route path.
plugins.blog.categoryItem
- Type:
string - Default:
/category/:name/
Category list route path. :name will be replaced by category name.
plugins.blog.tag
- Type:
string - Default:
/tag/
Tag map route path.
plugins.blog.tagItem
- Type:
string - Default:
/tag/:name/
Tag list route path. :name will be replaced by tag name.
plugins.blog.star
- Type:
string - Default:
/star/
Star article list route path.
plugins.blog.timeline
- Type:
string - Default:
/timeline/
Timeline list route path.
plugins.blog.hotReload
- Type:
boolean - Default: Whether using
--debugflag
Whether to enable hot reload in the development server.
Changelog
1e9f5-onb1230-ondd4a8-on8ebe9-on05c41-on497db-on25d44-oncad92-on2a306-on63a5e-ona0e17-on3cac1-on32267-onadde3-on6a956-on9856d-onad023-one07b5-onfd395-on1eb77-onbcf02-on716f9-on119ca-onf6ff0-onc8059-on3be03-on3c199-on