2023-01-29 16:44:02 +01:00
|
|
|
// Hooks
|
2023-03-24 21:49:37 +01:00
|
|
|
import { useApp } from 'shared/hooks/use-app.mjs'
|
2023-01-29 16:44:02 +01:00
|
|
|
// Dependencies
|
2023-02-05 16:49:36 +01:00
|
|
|
import { mdxLoader } from 'shared/mdx/loader.mjs'
|
2023-03-28 16:47:07 +02:00
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
2023-01-29 16:44:02 +01:00
|
|
|
// Components
|
2023-03-28 16:47:07 +02:00
|
|
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
2023-01-29 16:44:02 +01:00
|
|
|
import { MdxWrapper } from 'shared/components/wrappers/mdx.mjs'
|
|
|
|
import { ReadMore } from 'shared/components/mdx/read-more.mjs'
|
2022-12-26 15:35:22 +01:00
|
|
|
import { jargon } from 'site/jargon.mjs'
|
2023-04-09 15:57:25 +02:00
|
|
|
import { V3Wip } from 'shared/components/v3-wip.mjs'
|
2022-06-10 12:25:56 +02:00
|
|
|
|
2023-03-28 16:47:07 +02:00
|
|
|
// Translation namespaces used on this page
|
|
|
|
const namespaces = [...new Set(['docs', ...pageNs])]
|
|
|
|
|
|
|
|
const DocsPage = (props) => {
|
|
|
|
const app = useApp(props)
|
2022-06-10 12:25:56 +02:00
|
|
|
|
|
|
|
return (
|
2023-03-28 16:47:07 +02:00
|
|
|
<PageWrapper app={app}>
|
2023-04-09 15:57:25 +02:00
|
|
|
<div className="max-w-2xl">
|
|
|
|
<V3Wip />
|
|
|
|
</div>
|
2023-01-29 16:44:02 +01:00
|
|
|
</PageWrapper>
|
2022-06-10 12:25:56 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DocsPage
|
|
|
|
|
|
|
|
/*
|
|
|
|
* getStaticProps() is used to fetch data at build-time.
|
|
|
|
*
|
|
|
|
* On this page, it is loading the mdx (markdown) content
|
|
|
|
* from the markdown file on disk.
|
|
|
|
*
|
|
|
|
* This, in combination with getStaticPaths() below means this
|
|
|
|
* page will be used to render/generate all markdown/mdx content.
|
|
|
|
*
|
|
|
|
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
|
|
|
|
*/
|
2022-12-03 11:25:02 -06:00
|
|
|
export async function getStaticProps({ locale }) {
|
2023-03-28 16:47:07 +02:00
|
|
|
const { mdx } = await mdxLoader(locale, 'org', ['docs'], jargon[locale])
|
2022-06-10 12:25:56 +02:00
|
|
|
|
|
|
|
return {
|
|
|
|
props: {
|
2023-03-28 16:47:07 +02:00
|
|
|
...(await serverSideTranslations(locale, namespaces)),
|
2022-06-10 12:25:56 +02:00
|
|
|
mdx,
|
2023-03-28 16:47:07 +02:00
|
|
|
page: {
|
|
|
|
path: ['docs'],
|
|
|
|
},
|
2022-12-03 11:25:02 -06:00
|
|
|
},
|
2022-06-10 12:25:56 +02:00
|
|
|
}
|
|
|
|
}
|