mirror of
https://github.com/explosion/spaCy.git
synced 2025-03-26 12:54:12 +03:00
Implement layout
This commit is contained in:
parent
6de49b9f1a
commit
d3f95831aa
|
@ -1,9 +0,0 @@
|
||||||
const Layout = (args) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div>{args.children}</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Layout
|
|
|
@ -3,7 +3,7 @@ import { serialize } from 'next-mdx-remote/serialize'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote'
|
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import Layout from '../components/layout'
|
import Layout from '../src/templates'
|
||||||
import remarkPlugins from '../plugins/index.mjs'
|
import remarkPlugins from '../plugins/index.mjs'
|
||||||
|
|
||||||
import recordSection from '../meta/recordSections'
|
import recordSection from '../meta/recordSections'
|
||||||
|
|
|
@ -95,8 +95,8 @@ class Layout extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { pageContext, location, children } = this.props
|
const { location, children } = this.props
|
||||||
const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = pageContext
|
const { title, section, sectionTitle, teaser, theme = 'blue', searchExclude } = this.props
|
||||||
const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme
|
const uiTheme = nightly ? 'nightly' : legacy ? 'legacy' : theme
|
||||||
const bodyClass = classNames(`theme-${uiTheme}`, { 'search-exclude': !!searchExclude })
|
const bodyClass = classNames(`theme-${uiTheme}`, { 'search-exclude': !!searchExclude })
|
||||||
const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section)
|
const isDocs = ['usage', 'models', 'api', 'styleguide'].includes(section)
|
||||||
|
@ -122,13 +122,9 @@ class Layout extends React.Component {
|
||||||
<Progress />
|
<Progress />
|
||||||
</Navigation>
|
</Navigation>
|
||||||
{isDocs ? (
|
{isDocs ? (
|
||||||
<Docs pageContext={pageContext}>{content}</Docs>
|
<Docs pageContext={this.props}>{children}</Docs>
|
||||||
) : section === 'universe' ? (
|
) : section === 'universe' ? (
|
||||||
<Universe
|
<Universe pageContext={this.props} location={location} />
|
||||||
pageContext={pageContext}
|
|
||||||
location={location}
|
|
||||||
mdxComponents={mdxComponents}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
{children}
|
{children}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user