2023-05-20 13:22:36 +02:00
|
|
|
// Used in static paths
|
2023-07-19 19:08:41 +02:00
|
|
|
import { pages } from 'site/prebuild/docs.en.mjs'
|
2023-05-20 13:22:36 +02:00
|
|
|
// Dependencies
|
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
2023-10-09 12:29:03 +02:00
|
|
|
import { loadMdxAsStaticProps } from 'shared/mdx/load.mjs'
|
2023-11-03 15:36:09 +01:00
|
|
|
import { freeSewingConfig as config } from 'shared/config/freesewing.config.mjs'
|
2023-05-20 13:22:36 +02:00
|
|
|
// Components
|
|
|
|
import { PageWrapper, ns } from 'shared/components/wrappers/page.mjs'
|
2023-10-09 12:29:03 +02:00
|
|
|
//import { components } from 'shared/components/mdx/index.mjs'
|
2023-05-20 13:22:36 +02:00
|
|
|
import { MdxWrapper } from 'shared/components/wrappers/mdx.mjs'
|
2023-06-17 17:29:28 +02:00
|
|
|
import { Toc } from 'shared/components/mdx/toc.mjs'
|
2023-07-13 21:15:25 +02:00
|
|
|
import { MdxMetaData } from 'shared/components/mdx/meta.mjs'
|
2023-07-14 09:23:37 +02:00
|
|
|
import { PrevNext } from 'shared/components/prev-next.mjs'
|
2023-07-15 10:38:10 +02:00
|
|
|
import { NavLinks, Breadcrumbs, MainSections } from 'shared/components/navigation/sitenav.mjs'
|
2023-07-15 17:10:28 +02:00
|
|
|
import {
|
|
|
|
BaseLayout,
|
|
|
|
BaseLayoutLeft,
|
|
|
|
BaseLayoutProse,
|
|
|
|
BaseLayoutRight,
|
|
|
|
} from 'shared/components/base-layout.mjs'
|
2023-05-20 13:22:36 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This page is auto-generated by the prebuild script.
|
|
|
|
* Any changes you make will be overwritten on the next (pre)build.
|
|
|
|
*
|
|
|
|
* See the page-templates folder for more info.
|
|
|
|
*/
|
2023-10-09 12:29:03 +02:00
|
|
|
const DocsPage = ({ page, slug, frontmatter, mdx, mdxSlug }) => (
|
|
|
|
<PageWrapper {...page} title={frontmatter.title} intro={frontmatter.intro}>
|
|
|
|
<BaseLayout>
|
|
|
|
<BaseLayoutLeft>
|
|
|
|
<MainSections />
|
|
|
|
<NavLinks />
|
|
|
|
</BaseLayoutLeft>
|
|
|
|
<BaseLayoutProse>
|
|
|
|
<div className="w-full">
|
|
|
|
<Breadcrumbs />
|
|
|
|
<h1 className="break-words searchme">{frontmatter.title}</h1>
|
|
|
|
<div className="block xl:hidden">
|
2023-07-15 10:38:10 +02:00
|
|
|
<Toc toc={frontmatter.toc} wrap />
|
|
|
|
</div>
|
2023-10-09 12:29:03 +02:00
|
|
|
</div>
|
|
|
|
<MdxWrapper mdx={mdx} site="dev" slug={mdxSlug} />
|
|
|
|
<PrevNext slug={slug} />
|
|
|
|
</BaseLayoutProse>
|
|
|
|
<BaseLayoutRight>
|
|
|
|
<MdxMetaData frontmatter={frontmatter} slug={slug} locale="en" />
|
|
|
|
<div className="hidden xl:block">
|
|
|
|
<Toc toc={frontmatter.toc} wrap />
|
|
|
|
</div>
|
|
|
|
</BaseLayoutRight>
|
|
|
|
</BaseLayout>
|
|
|
|
</PageWrapper>
|
|
|
|
)
|
2023-05-20 13:22:36 +02:00
|
|
|
|
|
|
|
export default DocsPage
|
|
|
|
|
|
|
|
/*
|
|
|
|
* getStaticProps() is used to fetch data at build-time.
|
|
|
|
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
|
|
|
*/
|
|
|
|
export async function getStaticProps({ params }) {
|
|
|
|
return {
|
|
|
|
props: {
|
2023-10-17 08:14:15 +02:00
|
|
|
...(await serverSideTranslations('en', ['docs', 'tutorial', 'popout', ...ns])),
|
2023-10-09 12:29:03 +02:00
|
|
|
...(await loadMdxAsStaticProps({
|
|
|
|
language: 'en',
|
|
|
|
site: 'dev',
|
|
|
|
slug: params.slug.join('/'),
|
|
|
|
})),
|
2023-05-20 13:22:36 +02:00
|
|
|
slug: params.slug.join('/'),
|
2023-10-09 12:29:03 +02:00
|
|
|
mdxSlug: params.slug,
|
2023-05-20 13:22:36 +02:00
|
|
|
page: {
|
|
|
|
locale: 'en',
|
|
|
|
path: params.slug,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* getStaticPaths() is used to specify for which routes (think URLs)
|
|
|
|
* this page should be used to generate the result.
|
|
|
|
*
|
|
|
|
* On this page, it is returning a list of routes (think URLs) for all
|
|
|
|
* the mdx (markdown) content.
|
|
|
|
*
|
|
|
|
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
|
|
|
*/
|
|
|
|
export async function getStaticPaths() {
|
|
|
|
return {
|
2023-07-19 19:08:41 +02:00
|
|
|
paths: Object.keys(pages).map((slug) => '/' + slug),
|
2023-05-20 13:22:36 +02:00
|
|
|
fallback: false,
|
|
|
|
}
|
|
|
|
}
|