mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 19:46:57 +02:00
fix(v2): s/blogMetadatas/blogMetadata
This commit is contained in:
parent
03ac87a1e1
commit
8375236db4
4 changed files with 7 additions and 5 deletions
|
@ -9,7 +9,8 @@ import React, {useState} from 'react';
|
|||
import {renderRoutes} from 'react-router-config';
|
||||
|
||||
import routes from '@generated/routes'; // eslint-disable-line
|
||||
import blogMetadatas from '@generated/blogMetadatas'; // eslint-disable-line
|
||||
// TODO: Generalize for blog plugin.
|
||||
import blogMetadata from '@generated/blogMetadata'; // eslint-disable-line
|
||||
import docsMetadatas from '@generated/docsMetadatas'; // eslint-disable-line
|
||||
import env from '@generated/env'; // eslint-disable-line
|
||||
import docsSidebars from '@generated/docsSidebars'; // eslint-disable-line
|
||||
|
@ -19,7 +20,7 @@ import siteConfig from '@generated/docusaurus.config'; //eslint-disable-line
|
|||
import DocusaurusContext from '@docusaurus/context';
|
||||
|
||||
const data = {
|
||||
blogMetadatas,
|
||||
blogMetadata,
|
||||
docsMetadatas,
|
||||
docsSidebars,
|
||||
env,
|
||||
|
|
|
@ -12,6 +12,7 @@ module.exports = async function createSitemap({
|
|||
siteConfig = {},
|
||||
docsMetadatas = {},
|
||||
pagesMetadatas = [],
|
||||
// TODO: Generalize for blog plugin.
|
||||
blogMetadatas = [],
|
||||
}) {
|
||||
const allMetadatas = [
|
||||
|
|
|
@ -15,7 +15,7 @@ import DocusaurusContext from '@docusaurus/context';
|
|||
|
||||
function BlogPage(props) {
|
||||
const context = useContext(DocusaurusContext);
|
||||
const {blogMetadatas, language, siteConfig = {}} = context;
|
||||
const {blogMetadata, language, siteConfig = {}} = context;
|
||||
const {baseUrl, favicon} = siteConfig;
|
||||
|
||||
return (
|
||||
|
@ -28,7 +28,7 @@ function BlogPage(props) {
|
|||
</Head>
|
||||
<div>
|
||||
<ul>
|
||||
{blogMetadatas.map(metadata => (
|
||||
{blogMetadata.map(metadata => (
|
||||
<li key={metadata.permalink}>
|
||||
<Link to={metadata.permalink}>{metadata.permalink}</Link>
|
||||
</li>
|
||||
|
|
|
@ -27,7 +27,7 @@ module.exports = function createServerConfig(props) {
|
|||
// Static site generator webpack plugin.
|
||||
const docsFlatMetadatas = Object.values(docsMetadatas);
|
||||
|
||||
// TODO: Generalize this into blog plugin.
|
||||
// TODO: Generalize for blog plugin.
|
||||
const blogPermalinks = _.get(contentsStore, ['blog', 'contents'], []);
|
||||
const paths = [
|
||||
...blogPermalinks,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue