diff --git a/sites/lab/pages/code/index.mjs b/sites/lab/pages/code/index.mjs index 09d820a53e2..76de4c98c5b 100644 --- a/sites/lab/pages/code/index.mjs +++ b/sites/lab/pages/code/index.mjs @@ -8,8 +8,10 @@ import { Popout } from 'shared/components/popout.mjs' import { WebLink } from 'shared/components/web-link.mjs' import { siteConfig } from 'site/site.config.mjs' import { freeSewingConfig } from 'shared/config/freesewing.config.mjs' +import { ChoiceLink } from 'shared/components/choice-link.mjs' +import { GitHubIcon, CodeIcon } from 'shared/components/icons.mjs' -const ns = [...pageNs, 'labdocs'] +const ns = [...pageNs, 'labcode'] const RepoLink = ({ href = false }) => href ? ( @@ -32,13 +34,23 @@ const DocsPage = ({ page }) => { return (
-

All of the FreeSewing source code is available in our monorepo:

- - {siteConfig.repo !== freeSewingConfig.monorepo ? ( - <> -

In addition, this particular lab instance has additional source code hosted at:

+ } + > +

{t('labcode:monorepo')}:

+ +
+ {true || siteConfig.repo !== freeSewingConfig.monorepo ? ( + } + > +

{t('labcode:labrepo')}:

- +
) : null}
diff --git a/sites/lab/pages/code/labcode.en.yaml b/sites/lab/pages/code/labcode.en.yaml index 64638594eab..7678d5ebaab 100644 --- a/sites/lab/pages/code/labcode.en.yaml +++ b/sites/lab/pages/code/labcode.en.yaml @@ -1,5 +1,4 @@ -noDocs: The FreeSewing lab does not include documentation. -see: Instead, refer to -orgDocs: FreeSewing.org has documentation for makers, such as design options, sewing techniques, and instructions. -devDocs: FreeSewing.dev has documentation for developers and contributors, such as API docs and guides on how to get involved with the project. -enOnly: FreeSewing.dev is only available in English +monorepo: All of the FreeSewing source code is available in our monorepo on GitHub +labrepo: In addition, this particular lab instance has additional source code hosted at +lab: Source code specific to this lab +fscode: "FreeSewing's source code" diff --git a/sites/org/pages/patterns/index.mjs b/sites/org/pages/patterns/index.mjs new file mode 100644 index 00000000000..77a8af7367a --- /dev/null +++ b/sites/org/pages/patterns/index.mjs @@ -0,0 +1,51 @@ +// Dependencies +import dynamic from 'next/dynamic' +import { serverSideTranslations } from 'next-i18next/serverSideTranslations' +// Components +import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs' +import { Popout } from 'shared/components/popout.mjs' + +import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs' +import { ns as setsNs } from 'shared/components/account/sets.mjs' + +// Translation namespaces used on this page +const namespaces = [...new Set([...setsNs, ...authNs, ...pageNs])] + +/* + * Some things should never generated as SSR + * So for these, we run a dynamic import and disable SSR rendering + */ +const DynamicAuthWrapper = dynamic( + () => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper), + { ssr: false } +) + +/* + * Each page MUST be wrapped in the PageWrapper component. + * You also MUST spread props.page into this wrapper component + * when path and locale come from static props (as here) + * or set them manually. + */ +const SetsIndexPage = ({ page }) => ( + + + + This page has not been created yet + + + +) + +export default SetsIndexPage + +export async function getStaticProps({ locale }) { + return { + props: { + ...(await serverSideTranslations(locale, namespaces)), + page: { + locale, + path: ['patterns'], + }, + }, + } +} diff --git a/sites/shared/components/navigation/primary.mjs b/sites/shared/components/navigation/primary.mjs index 1cca1b98095..8d5a3cd2c38 100644 --- a/sites/shared/components/navigation/primary.mjs +++ b/sites/shared/components/navigation/primary.mjs @@ -17,6 +17,7 @@ import { FreeSewingIcon, HeartIcon, BulletIcon, + GitHubIcon, } from 'shared/components/icons.mjs' import { Breadcrumbs } from 'shared/components/breadcrumbs.mjs' @@ -42,6 +43,9 @@ export const icons = { community: (className = '') => , sets: (className = '') => , patterns: (className = '') => , + + // Lab + code: (className = '') => , } /* helper method to order nav entries */ diff --git a/sites/shared/prebuild/lab.mjs b/sites/shared/prebuild/lab.mjs index 7b4d86943c4..bb7d011c610 100644 --- a/sites/shared/prebuild/lab.mjs +++ b/sites/shared/prebuild/lab.mjs @@ -2,7 +2,17 @@ import { prebuildOrg } from './org.mjs' import path from 'path' import fse from 'fs-extra' -const copyFromOrg = ['account', 'confirm', 'designs', 'new', 'signin', 'signup', 'welcome'] +const copyFromOrg = [ + 'account', + 'confirm', + 'designs', + 'new', + 'patterns', + 'sets', + 'signin', + 'signup', + 'welcome', +] const copyOrgFiles = () => { const to = path.resolve('..', 'lab', 'pages')