mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 15:17:23 +02:00
* feat(v2): rewrite docs loading strategy * Prettify * Lint * Allow resolving from library root * minor changes, refactor * copyright header
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import React, {useContext} from 'react';
|
|
import {Link} from 'react-router-dom';
|
|
import Head from '@docusaurus/head';
|
|
import Layout from '@theme/Layout'; // eslint-disable-line
|
|
import BlogPost from '@theme/BlogPost'; // eslint-disable-line
|
|
|
|
import DocusaurusContext from '@docusaurus/context';
|
|
|
|
function BlogPage(props) {
|
|
const context = useContext(DocusaurusContext);
|
|
const {blogMetadatas, language, siteConfig = {}} = context;
|
|
const {baseUrl, favicon} = siteConfig;
|
|
|
|
return (
|
|
<Layout>
|
|
<Head>
|
|
<title>Blog</title>
|
|
{favicon && <link rel="shortcut icon" href={baseUrl + favicon} />}
|
|
{language && <html lang={language} />}
|
|
{language && <meta name="docsearch:language" content={language} />}
|
|
</Head>
|
|
<div>
|
|
<ul>
|
|
{blogMetadatas.map(metadata => (
|
|
<li key={metadata.permalink}>
|
|
<Link to={metadata.permalink}>{metadata.permalink}</Link>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
{props.children}
|
|
</div>
|
|
</Layout>
|
|
);
|
|
}
|
|
|
|
export default BlogPage;
|