docs(v2): document beforeDefaultRemarkPlugins and beforeDefaultRehypePlugins

This commit is contained in:
Yangshun Tay 2020-05-23 06:12:24 +08:00
parent 0e61da8f69
commit 2dbd0488d7

View file

@ -145,36 +145,42 @@ module.exports = {
'@docusaurus/plugin-content-blog', '@docusaurus/plugin-content-blog',
{ {
/** /**
* Path to data on filesystem * Path to data on filesystem relative to site dir.
* relative to site dir
*/ */
path: 'blog', path: 'blog',
/** /**
* URL for editing a blog post, example: 'https://github.com/facebook/docusaurus/edit/master/website/blog/' * URL for editing a blog post.
* Example: 'https://github.com/facebook/docusaurus/edit/master/website/blog/'
*/ */
editUrl: editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/', 'https://github.com/facebook/docusaurus/edit/master/website/blog/',
/** /**
* URL route for the blog section of your site * URL route for the blog section of your site.
* do not include trailing slash * *DO NOT* include a trailing slash.
*/ */
routeBasePath: 'blog', routeBasePath: 'blog',
include: ['*.md', '*.mdx'], include: ['*.md', '*.mdx'],
postsPerPage: 10, postsPerPage: 10,
/** /**
* Theme components used by the blog pages * Theme components used by the blog pages.
*/ */
blogListComponent: '@theme/BlogListPage', blogListComponent: '@theme/BlogListPage',
blogPostComponent: '@theme/BlogPostPage', blogPostComponent: '@theme/BlogPostPage',
blogTagsListComponent: '@theme/BlogTagsListPage', blogTagsListComponent: '@theme/BlogTagsListPage',
blogTagsPostsComponent: '@theme/BlogTagsPostsPage', blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
/** /**
* Remark and Rehype plugins passed to MDX * Remark and Rehype plugins passed to MDX.
*/ */
remarkPlugins: [ remarkPlugins: [
/* require('remark-math') */ /* require('remark-math') */
], ],
rehypePlugins: [], rehypePlugins: [],
/**
* Custom Remark and Rehype plugins passed to MDX before
* the default Docusaurus Remark and Rehype plugins.
*/
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
/** /**
* Truncate marker, can be a regex or string. * Truncate marker, can be a regex or string.
*/ */
@ -184,8 +190,8 @@ module.exports = {
*/ */
showReadingTime: true, showReadingTime: true,
/** /**
* Blog feed * Blog feed.
* If feedOptions is undefined, no rss feed will be generated * If feedOptions is undefined, no rss feed will be generated.
*/ */
feedOptions: { feedOptions: {
type: '', // required. 'rss' | 'feed' | 'all' type: '', // required. 'rss' | 'feed' | 'all'
@ -223,17 +229,17 @@ module.exports = {
'@docusaurus/plugin-content-docs', '@docusaurus/plugin-content-docs',
{ {
/** /**
* Path to data on filesystem * Path to data on filesystem relative to site dir.
* relative to site dir
*/ */
path: 'docs', path: 'docs',
/** /**
* URL for editing website repo, example: 'https://github.com/facebook/docusaurus/edit/master/website/' * URL for editing a doc in the website repo.
* Example: 'https://github.com/facebook/docusaurus/edit/master/website/'
*/ */
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/', editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
/** /**
* URL route for the blog section of your site * URL route for the blog section of your site.
* do not include trailing slash * *DO NOT* include a trailing slash.
*/ */
routeBasePath: 'docs', routeBasePath: 'docs',
homePageId: '_index', // Document id for docs home page. homePageId: '_index', // Document id for docs home page.
@ -255,6 +261,12 @@ module.exports = {
/* require('remark-math') */ /* require('remark-math') */
], ],
rehypePlugins: [], rehypePlugins: [],
/**
* Custom Remark and Rehype plugins passed to MDX before
* the default Docusaurus Remark and Rehype plugins.
*/
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
/** /**
* Whether to display the author who last updated the doc. * Whether to display the author who last updated the doc.
*/ */