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