mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
feat:docs translation + versioning 💥
This commit is contained in:
parent
31d333b82f
commit
0f38ae3979
20 changed files with 1133 additions and 520 deletions
|
@ -6,13 +6,11 @@ import Layout from '@theme/Layout'; // eslint-disable-line
|
|||
|
||||
export default class Docs extends React.Component {
|
||||
render() {
|
||||
const {route, docsData, siteConfig} = this.props;
|
||||
const currentDoc = docsData.find(data => data.path === route.path);
|
||||
|
||||
const {route, siteConfig, metadata} = this.props;
|
||||
return (
|
||||
<Layout {...this.props}>
|
||||
<Helmet>
|
||||
<title>{(currentDoc && currentDoc.title) || siteConfig.title}</title>
|
||||
<title>{(metadata && metadata.title) || siteConfig.title}</title>
|
||||
</Helmet>
|
||||
<div className={styles.mainContainer}>{this.props.children}</div>
|
||||
</Layout>
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
import React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import siteConfig from '@site/siteConfig';
|
||||
import styles from './styles.css';
|
||||
|
||||
/* eslint-disable react/prefer-stateless-function */
|
||||
export default class Layout extends React.Component {
|
||||
render() {
|
||||
const {children, pagesData, docsData, location} = this.props;
|
||||
const routeLinks = [...pagesData, ...docsData].map(
|
||||
const {children, pagesData, docsData = {}, location} = this.props;
|
||||
const docsLinks = Object.values(docsData).map(data => ({
|
||||
path: `${siteConfig.baseUrl}${data.permalink}`
|
||||
}));
|
||||
const routeLinks = [...pagesData, ...docsLinks].map(
|
||||
data =>
|
||||
data.path !== location.pathname && (
|
||||
<li key={data.path}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue