wip(org): Added blog post pages
This commit is contained in:
parent
8b7ea76325
commit
e47f47cf99
5 changed files with 142 additions and 24 deletions
|
@ -10,7 +10,7 @@ import rendertest from '@freesewing/rendertest'
|
|||
import tutorial from '@freesewing/tutorial'
|
||||
|
||||
|
||||
const mdxCustomComponents = (app, t) => ({
|
||||
const mdxCustomComponents = (app=false) => ({
|
||||
// Custom components
|
||||
Example: props => <Example
|
||||
{...props}
|
||||
|
|
|
@ -8,6 +8,8 @@ const currentChildren = current => Object.values(order(current))
|
|||
.filter(entry => (typeof entry === 'object'))
|
||||
|
||||
const ReadMore = props => {
|
||||
// Don't bother if we don't have the navigation tree in app
|
||||
if (!props.app) return null
|
||||
|
||||
const root = get(props.app.navigation, props.slug.split('/'))
|
||||
const list = []
|
||||
|
|
|
@ -38,12 +38,13 @@ const MdxWrapper = ({mdx, app, t, components={}}) => {
|
|||
// React component for MDX content
|
||||
const MdxContent = mdxModule ? mdxModule.default : Fragment
|
||||
|
||||
return (
|
||||
<div className="text-primary mdx max-w-prose text-base-content max-w-prose text-lg lg:text-xl">
|
||||
{mdxModule && <MdxContent components={allComponents}/>}
|
||||
<PrevNext app={app} />
|
||||
</div>
|
||||
)
|
||||
return app
|
||||
? (
|
||||
<div className="text-primary mdx max-w-prose text-base-content max-w-prose text-lg lg:text-xl">
|
||||
{mdxModule && <MdxContent components={allComponents}/>}
|
||||
<PrevNext app={app} />
|
||||
</div>
|
||||
) : <MdxContent components={allComponents}/>
|
||||
}
|
||||
|
||||
export default MdxWrapper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue