2023-07-18 21:27:36 -06:00
|
|
|
// Components
|
|
|
|
import { FrontmatterHead } from './docs.mjs'
|
|
|
|
import {
|
|
|
|
BaseLayout,
|
|
|
|
BaseLayoutLeft,
|
|
|
|
BaseLayoutProse,
|
|
|
|
BaseLayoutRight,
|
|
|
|
} from 'shared/components/base-layout.mjs'
|
|
|
|
import {
|
|
|
|
NavLinks,
|
|
|
|
Breadcrumbs,
|
|
|
|
MainSections,
|
|
|
|
ns as navNs,
|
|
|
|
} from 'shared/components/navigation/sitenav.mjs'
|
|
|
|
import { Toc } from 'shared/components/mdx/toc.mjs'
|
|
|
|
import { PrevNext } from 'shared/components/prev-next.mjs'
|
|
|
|
|
2023-07-20 08:52:50 +02:00
|
|
|
export const ns = [navNs, 'docs']
|
2023-07-18 21:27:36 -06:00
|
|
|
|
2023-07-21 18:19:07 +02:00
|
|
|
/** checks for a slug that isn't a post, to prevent a prev or next button to it */
|
2023-07-18 21:27:36 -06:00
|
|
|
const isEndSlug = (slug) => slug.split('/').length === 1
|
|
|
|
|
2023-07-21 18:19:07 +02:00
|
|
|
/** layout for a page that displays a blog, showcase or newsletter */
|
2023-07-20 18:27:59 +02:00
|
|
|
export const PostLayout = ({ children = [], slug, frontmatter, locale }) => (
|
|
|
|
<>
|
|
|
|
<FrontmatterHead {...{ frontmatter, slug, locale }} />
|
|
|
|
<BaseLayout>
|
|
|
|
<BaseLayoutLeft>
|
|
|
|
<MainSections />
|
|
|
|
<NavLinks />
|
|
|
|
</BaseLayoutLeft>
|
2023-07-18 21:27:36 -06:00
|
|
|
|
2023-07-20 18:27:59 +02:00
|
|
|
<BaseLayoutProse>
|
|
|
|
<div className="w-full">
|
|
|
|
<Breadcrumbs />
|
|
|
|
<h1 className="break-words searchme">{frontmatter.title}</h1>
|
|
|
|
<div className="block xl:hidden">
|
2023-07-18 21:27:36 -06:00
|
|
|
<Toc toc={frontmatter.toc} wrap />
|
|
|
|
</div>
|
2023-07-20 18:27:59 +02:00
|
|
|
</div>
|
|
|
|
{children}
|
|
|
|
<PrevNext noPrev={isEndSlug} noNext={isEndSlug} />
|
|
|
|
</BaseLayoutProse>
|
|
|
|
|
|
|
|
<BaseLayoutRight>
|
|
|
|
<div className="hidden xl:block">
|
|
|
|
<Toc toc={frontmatter.toc} wrap />
|
|
|
|
</div>
|
|
|
|
</BaseLayoutRight>
|
|
|
|
</BaseLayout>
|
|
|
|
</>
|
|
|
|
)
|