mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 04:57:05 +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.
|
routeBasePath: 'blog', // URL Route.
|
||||||
include: ['*.md', '*.mdx'], // Extensions to include.
|
include: ['*.md', '*.mdx'], // Extensions to include.
|
||||||
pageCount: 10, // How many entries per page.
|
pageCount: 10, // How many entries per page.
|
||||||
blogListComponent: '@theme/BlogList',
|
blogListComponent: '@theme/BlogListPage',
|
||||||
blogItemComponent: '@theme/BlogPost',
|
blogPostComponent: '@theme/BlogPostPage',
|
||||||
};
|
};
|
||||||
|
|
||||||
class DocusaurusPluginContentBlog {
|
class DocusaurusPluginContentBlog {
|
||||||
|
@ -113,7 +113,7 @@ class DocusaurusPluginContentBlog {
|
||||||
}
|
}
|
||||||
|
|
||||||
async contentLoaded({content, actions}) {
|
async contentLoaded({content, actions}) {
|
||||||
const {blogListComponent, blogItemComponent} = this.options;
|
const {blogListComponent, blogPostComponent} = this.options;
|
||||||
const {addRoute, createData} = actions;
|
const {addRoute, createData} = actions;
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
content.map(async metadataItem => {
|
content.map(async metadataItem => {
|
||||||
|
@ -145,7 +145,7 @@ class DocusaurusPluginContentBlog {
|
||||||
|
|
||||||
addRoute({
|
addRoute({
|
||||||
path: permalink,
|
path: permalink,
|
||||||
component: blogItemComponent,
|
component: blogPostComponent,
|
||||||
exact: true,
|
exact: true,
|
||||||
modules: {
|
modules: {
|
||||||
content: metadataItem.source,
|
content: metadataItem.source,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import React from 'react';
|
||||||
import Layout from '@theme/Layout'; // eslint-disable-line
|
import Layout from '@theme/Layout'; // eslint-disable-line
|
||||||
import BlogPostItem from '../BlogPostItem';
|
import BlogPostItem from '../BlogPostItem';
|
||||||
|
|
||||||
function BlogPage(props) {
|
function BlogListPage(props) {
|
||||||
const {
|
const {
|
||||||
metadata: {posts = []},
|
metadata: {posts = []},
|
||||||
entries: BlogPosts,
|
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