mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 20:46:58 +02:00
misc(v2): rename Blog components
This commit is contained in:
parent
fb56f853af
commit
1827c6f333
3 changed files with 6 additions and 6 deletions
|
@ -24,8 +24,8 @@ const DEFAULT_OPTIONS = {
|
|||
routeBasePath: 'blog', // URL Route.
|
||||
include: ['*.md', '*.mdx'], // Extensions to include.
|
||||
pageCount: 10, // How many entries per page.
|
||||
blogListComponent: '@theme/BlogList',
|
||||
blogItemComponent: '@theme/BlogPost',
|
||||
blogListComponent: '@theme/BlogListPage',
|
||||
blogPostComponent: '@theme/BlogPostPage',
|
||||
};
|
||||
|
||||
class DocusaurusPluginContentBlog {
|
||||
|
@ -113,7 +113,7 @@ class DocusaurusPluginContentBlog {
|
|||
}
|
||||
|
||||
async contentLoaded({content, actions}) {
|
||||
const {blogListComponent, blogItemComponent} = this.options;
|
||||
const {blogListComponent, blogPostComponent} = this.options;
|
||||
const {addRoute, createData} = actions;
|
||||
await Promise.all(
|
||||
content.map(async metadataItem => {
|
||||
|
@ -145,7 +145,7 @@ class DocusaurusPluginContentBlog {
|
|||
|
||||
addRoute({
|
||||
path: permalink,
|
||||
component: blogItemComponent,
|
||||
component: blogPostComponent,
|
||||
exact: true,
|
||||
modules: {
|
||||
content: metadataItem.source,
|
||||
|
|
|
@ -10,7 +10,7 @@ import React from 'react';
|
|||
import Layout from '@theme/Layout'; // eslint-disable-line
|
||||
import BlogPostItem from '../BlogPostItem';
|
||||
|
||||
function BlogPage(props) {
|
||||
function BlogListPage(props) {
|
||||
const {
|
||||
metadata: {posts = []},
|
||||
entries: BlogPosts,
|
||||
|
@ -35,4 +35,4 @@ function BlogPage(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default BlogPage;
|
||||
export default BlogListPage;
|
Loading…
Add table
Add a link
Reference in a new issue