more contained fixes to docs
This commit is contained in:
parent
2a21b10acc
commit
8a4c558cee
28 changed files with 213 additions and 217 deletions
|
@ -44,7 +44,7 @@ Nous cherchons également à embarquer plus de designers à bord de FreeSewing.
|
|||
|
||||
Grâce à nos forrmidables mécènes, les revenus ont encore augmenté cette année. Comme vous le savez peut-être, FreeSewing fait don de 100 % de ses revenus à Medecins Sans Frontières/Doctors Sans Frontières. Donc, ce matin, j'ai eu le grand honneur de faire un chèque de 4109,38€ à [MSF](https://www.msf.org/).
|
||||
|
||||
Cela fait **vraiment du bien** alors merci à tous nos mécènes**</a> pour leur soutien continu. Si vous souhaitez rejoindre ce groupe génial, [vous pouvez le faire ici](/patrons/join).</p>
|
||||
Cela fait **vraiment du bien** alors merci à tous nos mécènes pour leur soutien continu. Si vous souhaitez rejoindre ce groupe génial, [vous pouvez le faire ici](/patrons/join).
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -114,10 +114,10 @@ Je vertegenwoordigt FreeSewing in een niet-Engelse gemeenschap. Je kunt helpen v
|
|||
Je bent verantwoordelijk voor een specifiek FreeSewing ontwerp/patroon. Dan ben je *de persoon* om vragen te stellen over hoe je dat patroon maakt. Je zorgt ervoor dat de documentatie niet wordt vergeten. En je kan helpen met vragen of het triëren van probleemrapporten naar developers of ontwerpers.
|
||||
|
||||
**Patroonontwerper
|
||||
Je bedenkt nieuwe patronen voor FreeSewing. Je weet misschien niet eens hoe je een computer aanzet, maar je kan wel een verdomd goed bovenlijf tekenen.</p>
|
||||
Je bedenkt nieuwe patronen voor FreeSewing. Je weet misschien niet eens hoe je een computer aanzet, maar je kan wel een verdomd goed bovenlijf tekenen.
|
||||
|
||||
**Patroon Developer
|
||||
Je programmeert nieuwe ontwerpen voor FreeSewing. Je weet misschien niet hoe je naaipatronen moet ontwerpen, maar je bent niet bang van Javascript en ziet het zitten om met een ontwerper samen aan een nieuw patroon te werken.</p>
|
||||
Je programmeert nieuwe ontwerpen voor FreeSewing. Je weet misschien niet hoe je naaipatronen moet ontwerpen, maar je bent niet bang van Javascript en ziet het zitten om met een ontwerper samen aan een nieuw patroon te werken.
|
||||
|
||||
**Proofreader**
|
||||
Je kijkt de originele Engelse tekst of de vertalingen na, op zoek naar typfouten en/of grammaticafouten. Je stelt verbeteringen voor en helpt de toon en schrijfstijl van de documentatie en geschreven tekst op FreeSewing consequent te houden. Je beheerst de taal die je nakijkt goed.
|
||||
|
|
|
@ -38,9 +38,7 @@ FreeSewing завжди мав репутацію видання викрійо
|
|||
|
||||
Для тих, хто цікавиться розробкою патернів, ми оновили наш [підручник з розробки патернів](https://freesewing.dev/tutorial) , щоб ви могли розпочати роботу з нуля.
|
||||
|
||||
Є хороші новини і для перекладачів, адже тепер ми використовуємо [Crowdin](https://crowdin.com/) , який робить переклад легким і простим. </a>Якщо ви хочете допомогти з перекладом, або, можливо, навіть додати нову мову до FreeSewing, обов'язково напишіть нам на
|
||||
|
||||
.</p>
|
||||
Є хороші новини і для перекладачів, адже тепер ми використовуємо [Crowdin](https://crowdin.com/) , який робить переклад легким і простим. Якщо ви хочете допомогти з перекладом, або, можливо, навіть додати нову мову до FreeSewing, обов'язково напишіть нам на.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ Dies ist nicht der Fall *dieses Schnittmuster kommt mit 38 Optionen*. Als ob die
|
|||
|
||||
Das Ersetzen einer Messung durch einen errechneten Wert, der auf der Grundlage einer anderen Messung generiert wird, mag dem entgegengesetzt erscheinen, aber es besteht kein Grund zur Sorge. Wir haben dafür gesorgt, dass Sie sich immer noch und die Passform am Rücken kümmern können.
|
||||
|
||||
Muster, die früher die *die Rückenbreite als Mass erforderten, haben nun eine neue erweiterte Option: den *Rückenfaktor*. Es erlaubt Ihnen, die Berechnung Ihrer Rückenbreite zu optimieren, stellt aber sicher, dass diese innerhalb sinnvoller Parameter bleibt.</p>
|
||||
Muster, die früher die *die Rückenbreite als Mass erforderten, haben nun eine neue erweiterte Option: den *Rückenfaktor*. Es erlaubt Ihnen, die Berechnung Ihrer Rückenbreite zu optimieren, stellt aber sicher, dass diese innerhalb sinnvoller Parameter bleibt.
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ Microsoft - бегемот, а я просто хлопець. Я не можу
|
|||
|
||||
Як ви вважаєте, чи використовують Gmail для розсилки спаму? Ти знаєш, що це так. Як ви думаєте, вони коли-небудь заблокують всю електронну пошту, що надходить з Gmail? Ти ж знаєш, що вони цього не зроблять.
|
||||
|
||||
Тож минулої ночі я впровадив деякі зміни, щоб вирішити цю проблему. </em> Якщо ви маєте проблемну електронну адресу *, на додаток до звичайної електронної пошти, цей сайт надішле другий лист через Gmail. </p>
|
||||
Тож минулої ночі я впровадив деякі зміни, щоб вирішити цю проблему. *Якщо ви маєте проблемну електронну адресу*, на додаток до звичайної електронної пошти, цей сайт надішле другий лист через Gmail.
|
||||
|
||||
Я хотів би побачити, як вони це заблокують.
|
||||
|
||||
|
|
|
@ -34,9 +34,7 @@ Ich wollte den gleichen Ansatz in einer Website. Außer, dass sie nicht statisch
|
|||
|
||||
Ich habe zum ersten Mal von JAMstack erfahren, als ich anfing, mich mit dem Hosting für diese zentrale Dokumentationsseite zu befassen. Es wurde ursprünglich auf GitHub-Seiten gehostet, die kostenloses Hosting anbieten. Sie haben auch SSL oder einen benutzerdefinierten Domänennamen, aber Sie können nicht beides haben. Was eine Art Deal-Breaker war.
|
||||
|
||||
Auf der Suche nach Alternativen stolperte ich über [Netlify](https://www.netlify.com/), die sowohl SSL- als auch kundenspezifische Domains betreiben und ein kostenloses Angebot für Open-Source-Projekte haben (danke Jungs). Außerdem hat mich dieses Video von Netlify CEO Mathias Biilmann
|
||||
|
||||
sehr begeistert für JAMstack.</p>
|
||||
Auf der Suche nach Alternativen stolperte ich über [Netlify](https://www.netlify.com/), die sowohl SSL- als auch kundenspezifische Domains betreiben und ein kostenloses Angebot für Open-Source-Projekte haben (danke Jungs). Außerdem hat mich dieses Video von Netlify CEO Mathias Biilmann sehr begeistert für JAMstack.
|
||||
|
||||
Sofern Sie nicht mit JAMstack vertraut sind, schlage ich vor, dass Sie sich das Video ansehen, aber es läuft darauf hinaus:
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ title: "FreeSewing v2.1 : Trois nouveaux modèles, un mode expert et l'aide aux
|
|||
---
|
||||
|
||||
|
||||
Nous venons juste de publier FreeSewing v2.1 <unk> 🎉
|
||||
Nous venons juste de publier FreeSewing v2.1 🎉
|
||||
|
||||
## Rencontrez Pénelope, Waralee et Simone
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ GDPR стверджує, що ви повинні запитувати згод
|
|||
|
||||
Очевидно, що ЄС не прийде перевіряти ваш код, щоб побачити, чи взяли ви принцип приватності за задумом близько до серця. Але вона може (і, ймовірно, буде) впливати, коли щось піде не так.
|
||||
|
||||
</em> Уявіть собі дві компанії, в яких стався витік даних, причому одна з них не зробила нічого, щоб захистити конфіденційність своїх користувачів, тоді як інша вжила *заходів для зменшення шкоди.</p>
|
||||
Уявіть собі дві компанії, в яких стався витік даних, причому одна з них не зробила нічого, щоб захистити конфіденційність своїх користувачів, тоді як інша вжила *заходів для зменшення шкоди*.
|
||||
|
||||
Очевидно, що ЄС буде жорсткіше ставитися до компаній, які навіть не намагалися.
|
||||
|
||||
|
|
|
@ -18,9 +18,7 @@ Wat verandert er? Ik ben blij dat je het vraagt:
|
|||
|
||||
Dit was echt groot nieuws voor mij en iets waar we achter de schermen al een tijdje aan werkten. Maar 3 weken geleden onthulden we eindelijk ons nieuwe patronensysteem.
|
||||
|
||||
</a> De blogpost
|
||||
|
||||
voor de aankondiging bevat alle details, plus een openhartige blik op de financiële kant van dit project . Als je het nog niet gelezen hebt, raad ik het je aan.</p>
|
||||
De blogpost voor de aankondiging bevat alle details, plus een openhartige blik op de financiële kant van dit project . Als je het nog niet gelezen hebt, raad ik het je aan.
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -86,14 +86,14 @@ Nous disposons maintenant de tous les points de départ et d'arrivée pour dessi
|
|||
|
||||
For each of the anchor points (the ones marked in orange, not points 1 and 2) there is an option to control the spread upwards, and downwards:
|
||||
|
||||
- [Répartition de tête de manche vers le bas Q1](/docs/patterns/breanna/options/sleevecapq1spread1) : contrôle la répartition vers le bas dans le premier quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q1](/docs/patterns/breanna/options/sleevecapq1spread2) : contrôle la répartition vers le haut dans le premier quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q2](/docs/patterns/breanna/options/sleevecapq2spread1) : contrôle la répartition vers le bas dans le deuxième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q2](/docs/patterns/breanna/options/sleevecapq2spread2) : contrôle la répartition vers le haut dans le deuxième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q3](/docs/patterns/breanna/options/sleevecapq3spread1) : contrôle la répartition vers le haut dans le troisième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q3](/docs/patterns/breanna/options/sleevecapq3spread2) : contrôle la répartition vers le bas dans le troisième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q4](/docs/patterns/breanna/options/sleevecapq4spread1) : contrôle la répartition vers le haut dans le quatrième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q4](/docs/patterns/breanna/options/sleevecapq4spread2) : contrôle la répartition vers le bas dans le quatrième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q1](/docs/patterns/breanna/options/sleevecapq1spread1) : contrôle la répartition vers le bas dans le premier quadrant
|
||||
- [Répartition de tête de manche vers le haut Q1](/docs/patterns/breanna/options/sleevecapq1spread2) : contrôle la répartition vers le haut dans le premier quadrant
|
||||
- [Répartition de tête de manche vers le bas Q2](/docs/patterns/breanna/options/sleevecapq2spread1) : contrôle la répartition vers le bas dans le deuxième quadrant
|
||||
- [Répartition de tête de manche vers le haut Q2](/docs/patterns/breanna/options/sleevecapq2spread2) : contrôle la répartition vers le haut dans le deuxième quadrant
|
||||
- [Répartition de tête de manche vers le haut Q3](/docs/patterns/breanna/options/sleevecapq3spread1) : contrôle la répartition vers le haut dans le troisième quadrant
|
||||
- [Répartition de tête de manche vers le bas Q3](/docs/patterns/breanna/options/sleevecapq3spread2) : contrôle la répartition vers le bas dans le troisième quadrant
|
||||
- [Répartition de tête de manche vers le haut Q4](/docs/patterns/breanna/options/sleevecapq4spread1) : contrôle la répartition vers le haut dans le quatrième quadrant
|
||||
- [Répartition de tête de manche vers le bas Q4](/docs/patterns/breanna/options/sleevecapq4spread2) : contrôle la répartition vers le bas dans le quatrième quadrant
|
||||
|
||||
<Note>
|
||||
|
||||
|
|
|
@ -86,14 +86,14 @@ Nous disposons maintenant de tous les points de départ et d'arrivée pour dessi
|
|||
|
||||
For each of the anchor points (the ones marked in orange, not points 1 and 2) there is an option to control the spread upwards, and downwards:
|
||||
|
||||
- [Répartition de tête de manche vers le bas Q1](/docs/patterns/brian/options/sleevecapq1spread1) : contrôle la répartition vers le bas dans le premier quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q1](/docs/patterns/brian/options/sleevecapq1spread2) : contrôle la répartition vers le haut dans le premier quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q2](/docs/patterns/brian/options/sleevecapq2spread1) : contrôle la répartition vers le bas dans le deuxième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q2](/docs/patterns/brian/options/sleevecapq2spread2) : contrôle la répartition vers le haut dans le deuxième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q3](/docs/patterns/brian/options/sleevecapq3spread1) : contrôle la répartition vers le haut dans le troisième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q3](/docs/patterns/brian/options/sleevecapq3spread2) : contrôle la répartition vers le bas dans le troisième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le haut Q4](/docs/patterns/brian/options/sleevecapq4spread1) : contrôle la répartition vers le haut dans le quatrième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q4](/docs/patterns/brian/options/sleevecapq4spread2) : contrôle la répartition vers le bas dans le quatrième quadrant<0><0>
|
||||
- [Répartition de tête de manche vers le bas Q1](/docs/patterns/brian/options/sleevecapq1spread1) : contrôle la répartition vers le bas dans le premier quadrant
|
||||
- [Répartition de tête de manche vers le haut Q1](/docs/patterns/brian/options/sleevecapq1spread2) : contrôle la répartition vers le haut dans le premier quadrant
|
||||
- [Répartition de tête de manche vers le bas Q2](/docs/patterns/brian/options/sleevecapq2spread1) : contrôle la répartition vers le bas dans le deuxième quadrant
|
||||
- [Répartition de tête de manche vers le haut Q2](/docs/patterns/brian/options/sleevecapq2spread2) : contrôle la répartition vers le haut dans le deuxième quadrant
|
||||
- [Répartition de tête de manche vers le haut Q3](/docs/patterns/brian/options/sleevecapq3spread1) : contrôle la répartition vers le haut dans le troisième quadrant
|
||||
- [Répartition de tête de manche vers le bas Q3](/docs/patterns/brian/options/sleevecapq3spread2) : contrôle la répartition vers le bas dans le troisième quadrant
|
||||
- [Répartition de tête de manche vers le haut Q4](/docs/patterns/brian/options/sleevecapq4spread1) : contrôle la répartition vers le haut dans le quatrième quadrant
|
||||
- [Répartition de tête de manche vers le bas Q4](/docs/patterns/brian/options/sleevecapq4spread2) : contrôle la répartition vers le bas dans le quatrième quadrant
|
||||
|
||||
<Note>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ title: "Привіт акула: Інструкція з пошиття"
|
|||
|
||||
- Виріжте шматки чорної тканини розміром з очі на частинах тіла.
|
||||
- Стабілізуйте тканину за допомогою невеликої кількості проміжного шару.
|
||||
- </em> Білою ниткою, вручну або машиною _прикріпіть зіниці до очей, як люверси.</li> </ul>
|
||||
- Білою ниткою, вручну або машиною _прикріпіть_ зіниці до очей, як люверси.
|
||||
|
||||
<Tip>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ designs:
|
|||
---
|
||||
|
||||
|
||||
Joost maakte deze Charlie Chinos broek en de hele FreeSewing community viel meteen voor het ontwerp van de broek en de stof. </em> Joost kon ons niet vertellen waar de stof vandaan kwam (het was uit zijn voorraad), maar *gaf een paar dagen later wel het Charlie patroon vrij.</p>
|
||||
Joost maakte deze Charlie Chinos broek en de hele FreeSewing community viel meteen voor het ontwerp van de broek en de stof. Joost kon ons niet vertellen waar de stof vandaan kwam (het was uit zijn voorraad), maar *gaf* een paar dagen later wel het Charlie patroon vrij.
|
||||
|
||||
Deze foto is van Joost, [@j__st op Twitter](https://twitter.com/j__st). Hij werd hier gepost met toestemming.
|
||||
|
||||
|
|
|
@ -8,12 +8,17 @@ import {
|
|||
BaseLayoutProse,
|
||||
BaseLayoutRight,
|
||||
} from 'shared/components/base-layout.mjs'
|
||||
import { NavLinks, Breadcrumbs, MainSections } from 'shared/components/navigation/sitenav.mjs'
|
||||
import {
|
||||
NavLinks,
|
||||
Breadcrumbs,
|
||||
MainSections,
|
||||
ns as navNs,
|
||||
} from 'shared/components/navigation/sitenav.mjs'
|
||||
import { Toc } from 'shared/components/mdx/toc.mjs'
|
||||
import { MdxMetaData } from 'shared/components/mdx/meta.mjs'
|
||||
import { PrevNext } from 'shared/components/prev-next.mjs'
|
||||
|
||||
export const ns = [] //navNs
|
||||
export const ns = [navNs] //navNs
|
||||
|
||||
export const DocsLayout = ({ children = [], slug, frontmatter }) => {
|
||||
const { siteNav } = useNavigation({ ignoreControl: true })
|
||||
|
@ -36,7 +41,7 @@ export const DocsLayout = ({ children = [], slug, frontmatter }) => {
|
|||
<meta property="og:url" content={`https://freesewing.org/${slug}`} key="url" />
|
||||
<meta property="og:locale" content="en" key="locale" />
|
||||
<meta property="og:site_name" content="freesewing.org" key="site" />
|
||||
<title>{frontmatter.title} - FreeSewing.org</title>
|
||||
<title>{frontmatter.title + '- FreeSewing.org'}</title>
|
||||
</Head>
|
||||
|
||||
<BaseLayout>
|
||||
|
|
|
@ -6,6 +6,7 @@ import { designs, tags } from 'shared/config/designs.mjs'
|
|||
import { objUpdate } from 'shared/utils.mjs'
|
||||
import { orderedSlugLut } from 'shared/hooks/use-navigation-helpers.mjs'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
/*
|
||||
* prebuildNavvigation[locale] holds the navigation structure based on MDX content.
|
||||
|
@ -87,7 +88,7 @@ const sitePages = (t = false, control = 99) => {
|
|||
m: 1,
|
||||
s: 'new',
|
||||
h: 1,
|
||||
t: t('new'),
|
||||
t: t('sections:new'),
|
||||
pattern: {
|
||||
t: t('patternNew'),
|
||||
s: 'new/pattern',
|
||||
|
@ -178,9 +179,12 @@ export const useNavigation = (param = {}, extra = []) => {
|
|||
// We need the account if we want to take control into account
|
||||
const { account } = useAccount()
|
||||
|
||||
const control = ignoreControl ? undefined : account.control
|
||||
|
||||
const value = useMemo(() => {
|
||||
const siteNav = {
|
||||
...pbn[locale],
|
||||
...sitePages(t, ignoreControl ? undefined : account.control),
|
||||
...sitePages(t, control),
|
||||
}
|
||||
for (const [_path, _data] of extra) {
|
||||
objUpdate(siteNav, _path, _data)
|
||||
|
@ -208,4 +212,7 @@ export const useNavigation = (param = {}, extra = []) => {
|
|||
siteNav, // Site navigation
|
||||
slugLut: orderedSlugLut(siteNav), // Slug lookup table
|
||||
}
|
||||
}, [locale, extra, control])
|
||||
|
||||
return value
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
|||
import { useState, useEffect } from 'react'
|
||||
// Components
|
||||
import Head from 'next/head'
|
||||
import { PageWrapper, ns } from 'shared/components/wrappers/page.mjs'
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { Spinner } from 'shared/components/spinner.mjs'
|
||||
import { components } from 'shared/components/mdx/index.mjs'
|
||||
import { MdxWrapper } from 'shared/components/wrappers/mdx.mjs'
|
||||
import { Toc } from 'shared/components/mdx/toc.mjs'
|
||||
import { DocsLayout } from 'site/components/layouts/docs.mjs'
|
||||
import { DocsLayout, ns as layoutNs } from 'site/components/layouts/docs.mjs'
|
||||
|
||||
const ns = [...pageNs, layoutNs]
|
||||
/*
|
||||
* PLEASE READ THIS BEFORE YOU TRY TO REFACTOR THIS PAGE
|
||||
*
|
||||
|
@ -40,42 +40,13 @@ export const Loading = () => (
|
|||
<Spinner className="w-24 h-24 color-primary animate-spin m-auto mt-8" />
|
||||
)
|
||||
|
||||
const HeadInfo = ({ frontmatter, locale, slug }) => (
|
||||
<Head>
|
||||
<meta property="og:title" content={frontmatter.title} key="title" />
|
||||
<meta property="og:type" content="article" key="type" />
|
||||
<meta property="og:description" content={``} key="type" />
|
||||
<meta property="og:article:author" content="Joost De Cock" key="author" />
|
||||
<meta
|
||||
property="og:image"
|
||||
content={`https://canary.backend.freesewing.org/og-img/en/org/${slug}}`}
|
||||
key="image"
|
||||
/>
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:url" content={`https://freesewing.org/${slug}`} key="url" />
|
||||
<meta property="og:locale" content={locale} key="locale" />
|
||||
<meta property="og:site_name" content="freesewing.org" key="site" />
|
||||
<title>{frontmatter.title} - FreeSewing.org</title>
|
||||
</Head>
|
||||
)
|
||||
|
||||
export const Page = ({ page, frontmatter, slug, locale, MDX }) => (
|
||||
<PageWrapper
|
||||
{...page}
|
||||
title={frontmatter.title}
|
||||
layout={(props) => <DocsLayout {...props} {...{ slug, frontmatter }} />}
|
||||
layout={(props) => <DocsLayout {...props} {...{ slug: page.path.join('/'), frontmatter }} />}
|
||||
>
|
||||
<HeadInfo {...{ frontmatter, locale, slug }} />
|
||||
<div className="flex flex-row-reverse flex-wrap xl:flex-nowrap justify-end">
|
||||
{frontmatter.toc && frontmatter.toc.length > 0 && (
|
||||
<div className="mb-8 w-full xl:w-80 2xl:w-96 xl:pl-8 2xl:pl-16">
|
||||
<Toc toc={frontmatter.toc} wrap />
|
||||
</div>
|
||||
)}
|
||||
<MdxWrapper>{MDX}</MdxWrapper>
|
||||
</div>
|
||||
</PageWrapper>
|
||||
)
|
||||
|
||||
|
@ -87,7 +58,7 @@ const EnDocsPage = ({ page, slug }) => {
|
|||
/* Load MDX dynamically */
|
||||
useEffect(() => {
|
||||
const loadMDX = async () => {
|
||||
import(`../../../../markdown/org/${slug}/en.md`).then((mod) => {
|
||||
import(`orgmarkdown/docs/${slug}/en.md`).then((mod) => {
|
||||
setFrontmatter(mod.frontmatter)
|
||||
const Component = mod.default
|
||||
setMDX(<Component components={components('org')} />)
|
||||
|
@ -107,7 +78,7 @@ const FrDocsPage = ({ page, slug }) => {
|
|||
/* Load MDX dynamically */
|
||||
useEffect(() => {
|
||||
const loadMDX = async () => {
|
||||
import(`../../../../markdown/org/${slug}/fr.md`).then((mod) => {
|
||||
import(`orgmarkdown/docs/${slug}/fr.md`).then((mod) => {
|
||||
setFrontmatter(mod.frontmatter)
|
||||
const Component = mod.default
|
||||
setMDX(<Component components={components('org')} />)
|
||||
|
@ -127,7 +98,7 @@ const EsDocsPage = ({ page, slug }) => {
|
|||
/* Load MDX dynamically */
|
||||
useEffect(() => {
|
||||
const loadMDX = async () => {
|
||||
import(`../../../../markdown/org/${slug}/es.md`).then((mod) => {
|
||||
import(`orgmarkdown/docs/${slug}/es.md`).then((mod) => {
|
||||
setFrontmatter(mod.frontmatter)
|
||||
const Component = mod.default
|
||||
setMDX(<Component components={components('org')} />)
|
||||
|
@ -147,7 +118,7 @@ const DeDocsPage = ({ page, slug }) => {
|
|||
/* Load MDX dynamically */
|
||||
useEffect(() => {
|
||||
const loadMDX = async () => {
|
||||
import(`../../../../markdown/org/${slug}/de.md`).then((mod) => {
|
||||
import(`orgmarkdown/docs/${slug}/de.md`).then((mod) => {
|
||||
setFrontmatter(mod.frontmatter)
|
||||
const Component = mod.default
|
||||
setMDX(<Component components={components('org')} />)
|
||||
|
@ -167,7 +138,7 @@ const NlDocsPage = ({ page, slug }) => {
|
|||
/* Load MDX dynamically */
|
||||
useEffect(() => {
|
||||
const loadMDX = async () => {
|
||||
import(`../../../../markdown/org/${slug}/nl.md`).then((mod) => {
|
||||
import(`orgmarkdown/docs/${slug}/nl.md`).then((mod) => {
|
||||
setFrontmatter(mod.frontmatter)
|
||||
const Component = mod.default
|
||||
setMDX(<Component components={components('org')} />)
|
||||
|
@ -197,7 +168,7 @@ export async function getStaticProps({ locale, params }) {
|
|||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations('en', ['docs', ...ns])),
|
||||
slug: 'docs/' + params.slug.join('/'),
|
||||
slug: params.slug.join('/'),
|
||||
locale,
|
||||
page: {
|
||||
locale,
|
||||
|
|
|
@ -16,7 +16,9 @@ const DocsHomePage = ({ page, slug, locale }) => {
|
|||
/* Load MDX dynamically */
|
||||
useEffect(() => {
|
||||
const loadMDX = async () => {
|
||||
import(`../../../../markdown/org/docs/${locale}.md`).then((mod) => {
|
||||
import(
|
||||
/* webpackInclude: /docs\/\w+\.md/ */ `../../../../markdown/org/docs/${locale}.md`
|
||||
).then((mod) => {
|
||||
setFrontmatter(mod.frontmatter)
|
||||
const Component = mod.default
|
||||
setMDX(<Component components={components('org')} />)
|
||||
|
|
|
@ -4,6 +4,14 @@ import { Spinner } from 'shared/components/spinner.mjs'
|
|||
import { MdxWrapper } from './wrapper.mjs'
|
||||
import { components } from 'shared/components/mdx/index.mjs'
|
||||
|
||||
export const loaders = {
|
||||
en: (path) => import(`orgmarkdown/docs/${path}/en.md`),
|
||||
de: (path) => import(`orgmarkdown/docs/${path}/de.md`),
|
||||
fr: (path) => import(`orgmarkdown/docs/${path}/fr.md`),
|
||||
es: (path) => import(`orgmarkdown/docs/${path}/es.md`),
|
||||
nl: (path) => import(`orgmarkdown/docs/${path}/nl.md`),
|
||||
uk: (path) => import(`orgmarkdown/docs/${path}/uk.md`),
|
||||
}
|
||||
/*
|
||||
* Webpack will check on disk for all possible files matching this
|
||||
* dynamic import. So unless we divide it up a bit your computer
|
||||
|
@ -11,12 +19,12 @@ import { components } from 'shared/components/mdx/index.mjs'
|
|||
*
|
||||
* This will return a language-specific component
|
||||
*/
|
||||
const dynamicDocsFactory = (lang) => {
|
||||
return function DynamicDocs({ path }) {
|
||||
|
||||
function DynamicDocs({ path, lang }) {
|
||||
const [frontmatter, setFrontmatter] = useState({})
|
||||
const mdx = dynamic(
|
||||
() =>
|
||||
import(`orgmarkdown/docs/${path}/${lang}.md`).then((mod) => {
|
||||
loaders[lang](path).then((mod) => {
|
||||
setFrontmatter(mod.frontmatter)
|
||||
return mod
|
||||
}),
|
||||
|
@ -30,25 +38,11 @@ const dynamicDocsFactory = (lang) => {
|
|||
</MdxWrapper>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Instantiate language-specific components
|
||||
*/
|
||||
const OrgDocsEn = dynamicDocsFactory('en')
|
||||
const OrgDocsDe = dynamicDocsFactory('de')
|
||||
const OrgDocsFr = dynamicDocsFactory('fr')
|
||||
const OrgDocsEs = dynamicDocsFactory('es')
|
||||
const OrgDocsNl = dynamicDocsFactory('nl')
|
||||
|
||||
/*
|
||||
* Return language-specific component
|
||||
*/
|
||||
export const DynamicOrgDocs = ({ path = false, language = 'en' }) => {
|
||||
if (!path) return null
|
||||
if (language === 'en') return <OrgDocsEn path={path} />
|
||||
if (language === 'de') return <OrgDocsDe path={path} />
|
||||
if (language === 'es') return <OrgDocsEs path={path} />
|
||||
if (language === 'fr') return <OrgDocsFr path={path} />
|
||||
if (language === 'nl') return <OrgDocsNl path={path} />
|
||||
return <DynamicDocs path={path} lang={language} />
|
||||
}
|
||||
|
|
|
@ -11,6 +11,13 @@ import { Legend } from './legend.mjs'
|
|||
import { DocsTitle, DocsLink } from './docs-helpers.mjs'
|
||||
import { V3Wip } from '../v3-wip.mjs'
|
||||
|
||||
const WipWithReadMore = (props) => (
|
||||
<>
|
||||
<V3Wip {...props} />
|
||||
<ReadMore />
|
||||
</>
|
||||
)
|
||||
|
||||
export const components = (site = 'org') => {
|
||||
const base = {
|
||||
// Custom components
|
||||
|
@ -48,9 +55,9 @@ export const components = (site = 'org') => {
|
|||
}
|
||||
: {
|
||||
...base,
|
||||
PatternDocs: V3Wip,
|
||||
PatternOptions: V3Wip,
|
||||
PatternMeasurements: V3Wip,
|
||||
PatternDocs: WipWithReadMore,
|
||||
PatternOptions: WipWithReadMore,
|
||||
PatternMeasurements: WipWithReadMore,
|
||||
Gauge: V3Wip,
|
||||
Legend,
|
||||
}
|
||||
|
|
|
@ -8,7 +8,13 @@ export const Legend = ({ caption = false, part = '', children = null }) => {
|
|||
head: 370,
|
||||
},
|
||||
}
|
||||
const patternProps = new LegendDesign(settings).draft().getRenderProps()
|
||||
const pattern = new LegendDesign(settings).draft()
|
||||
|
||||
const patternProps = {
|
||||
renderProps: pattern.getRenderProps(),
|
||||
logs: pattern.getLogs(),
|
||||
}
|
||||
|
||||
if (caption)
|
||||
console.log(
|
||||
'Passing the caption prop to @freesewing/components/Legend is deprecated. See: https://github.com/freesewing/freesewing/issues/1043'
|
||||
|
|
|
@ -27,7 +27,8 @@ export const TimeAgo = ({ date, t }) => {
|
|||
return `${ago} ${t('ago')}`
|
||||
}
|
||||
|
||||
const PersonList = ({ list }) => (
|
||||
const PersonList = ({ list }) =>
|
||||
list ? (
|
||||
<ul>
|
||||
{list.map((id) => (
|
||||
<li key={id}>
|
||||
|
@ -39,11 +40,11 @@ const PersonList = ({ list }) => (
|
|||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)
|
||||
) : null
|
||||
|
||||
const CreditsList = ({ updates, frontmatter, locale, t }) => (
|
||||
<ul className="list list-inside list-disc">
|
||||
{updates.a.length > 0 ? (
|
||||
{updates.a?.length > 0 ? (
|
||||
<li className="list-none">
|
||||
<b>{t('authors')}:</b>
|
||||
<PersonList list={updates.a} />
|
||||
|
|
|
@ -5,6 +5,7 @@ import { NavigationContext } from 'shared/context/navigation-context.mjs'
|
|||
import { useNavigation } from 'site/hooks/use-navigation.mjs'
|
||||
import { BulletIcon, RightIcon } from 'shared/components/icons.mjs'
|
||||
import { pageHasChildren } from 'shared/utils.mjs'
|
||||
import orderBy from 'lodash.orderby'
|
||||
|
||||
export const getRoot = {
|
||||
dev: (root, nav) => {
|
||||
|
@ -23,17 +24,20 @@ export const getRoot = {
|
|||
/*
|
||||
* This is a recursive function, so it needs to be lean
|
||||
*/
|
||||
const RenderTree = ({ tree, recurse, depth = 1, level = 0 }) => (
|
||||
const RenderTree = ({ tree, recurse, depth = 1, level = 0 }) => {
|
||||
const orderedTree = orderBy(tree, ['o', 't'], ['asc', 'asc']).filter(
|
||||
(item) => typeof item === 'object'
|
||||
)
|
||||
|
||||
return (
|
||||
<ul className="w-full list">
|
||||
{Object.keys(tree)
|
||||
.filter((key) => key.length > 1)
|
||||
.map((key, i) => {
|
||||
{orderedTree.map((item, i) => {
|
||||
/*
|
||||
* Does this have children?
|
||||
*/
|
||||
const hasChildren =
|
||||
recurse && (!depth || level < depth) && pageHasChildren(tree[key])
|
||||
? tree[key].s.replaceAll('/', '')
|
||||
recurse && (!depth || level < depth) && pageHasChildren(item)
|
||||
? item.s.replaceAll('/', '')
|
||||
: false
|
||||
|
||||
/*
|
||||
|
@ -47,15 +51,15 @@ const RenderTree = ({ tree, recurse, depth = 1, level = 0 }) => (
|
|||
<details className={`w-full inline flex flex-row`}>
|
||||
<summary className="hover:bg-opacity-20 bg-secondary bg-opacity-0 block w-full flex flex-row items-center gap-0.5 lg:gap-1 px-1 lg:px-2">
|
||||
<RightIcon className={`w-4 h-4 summary-chevron transition-all`} stroke={3} />
|
||||
<Link href={`/${tree[key].s}`}>{tree[key].t}</Link>
|
||||
<Link href={`/${item.s}`}>{item.t}</Link>
|
||||
</summary>
|
||||
<RenderTree tree={tree[key]} {...{ recurse, depth }} level={level + 1} />
|
||||
<RenderTree tree={item} {...{ recurse, depth }} level={level + 1} />
|
||||
</details>
|
||||
) : (
|
||||
<>
|
||||
<BulletIcon className="w-2 h-2 mt-2 mx-1 ml-2 lg:ml-3 shrink-0" fill stroke={0} />
|
||||
<Link href={`/${tree[key].s}`} className="break-all">
|
||||
{tree[key].t}
|
||||
<Link href={`/${item.s}`} className="break-all">
|
||||
{item.t}
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
|
@ -64,6 +68,7 @@ const RenderTree = ({ tree, recurse, depth = 1, level = 0 }) => (
|
|||
})}
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
export const ReadMore = ({
|
||||
recurse = 0,
|
||||
|
@ -86,5 +91,7 @@ export const ReadMore = ({
|
|||
|
||||
const tree = root === false ? getRoot[site](slug, siteNav) : getRoot[site](root, siteNav)
|
||||
|
||||
if (!tree) return null
|
||||
|
||||
return <RenderTree {...{ tree, recurse, depth }} />
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ export const TabbedExample = ({
|
|||
withHead,
|
||||
paperless,
|
||||
settings,
|
||||
patternProps,
|
||||
}) => {
|
||||
if (settings)
|
||||
settings = {
|
||||
|
@ -89,49 +90,50 @@ export const TabbedExample = ({
|
|||
}
|
||||
else settings = { margin: 5 }
|
||||
if (withHead) settings.measurements = { head: 300 }
|
||||
|
||||
if (children && !patternProps) {
|
||||
const pattern = buildPattern(children, settings, tutorial, paperless)
|
||||
|
||||
// Check that it's a valid pattern
|
||||
if (!pattern.sample) return null
|
||||
|
||||
const patternProps = {
|
||||
patternProps = {
|
||||
renderProps: settings.sample
|
||||
? pattern.sample().getRenderProps()
|
||||
: pattern.draft().getRenderProps(),
|
||||
logs: pattern.getLogs(),
|
||||
}
|
||||
}
|
||||
|
||||
if (tutorial && !previewFirst)
|
||||
return (
|
||||
<div className="my-8">
|
||||
<Tabs tabs="Code, Preview, X-Ray">
|
||||
<Tab key="code">{children}</Tab>
|
||||
const tabs = []
|
||||
const tabNames = ['Preview']
|
||||
tabs.push(
|
||||
<Tab key="preview">
|
||||
<ShowPattern {...patternProps} />
|
||||
</Tab>
|
||||
<Tab key="xray">
|
||||
<ShowPattern {...patternProps} mode="xray" />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
{caption && (
|
||||
<div className="text-center italic -mt-4">
|
||||
<Md>{caption}</Md>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
if (children) {
|
||||
const codeTab = <Tab key="code">{children}</Tab>
|
||||
|
||||
return (
|
||||
<div className="my-8">
|
||||
<Tabs tabs="Preview, Code, X-Ray">
|
||||
<Tab key="preview">
|
||||
<ShowPattern {...patternProps} />
|
||||
</Tab>
|
||||
<Tab key="code">{children}</Tab>
|
||||
if (tutorial && !previewFirst) {
|
||||
tabs.unshift(codeTab)
|
||||
tabNames.unshift('Code')
|
||||
} else {
|
||||
tabs.push(codeTab)
|
||||
tabNames.push('Code')
|
||||
}
|
||||
}
|
||||
|
||||
tabs.push(
|
||||
<Tab key="xray">
|
||||
<ShowPattern {...patternProps} mode="xray" />
|
||||
</Tab>
|
||||
</Tabs>
|
||||
)
|
||||
tabNames.push('X-Ray')
|
||||
|
||||
return (
|
||||
<div className="my-8">
|
||||
<Tabs tabs={tabNames.join(', ')}>{tabs}</Tabs>
|
||||
{caption && (
|
||||
<div className="text-center italic -mt-4">
|
||||
<Md>{caption}</Md>
|
||||
|
|
|
@ -7,6 +7,7 @@ import orderBy from 'lodash.orderby'
|
|||
import { icons } from 'shared/components/navigation/primary.mjs'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
||||
export const ns = ['sections']
|
||||
/*
|
||||
* This returns only those children that are expected to show up
|
||||
* in the side navigation. Specifically:
|
||||
|
|
|
@ -38,6 +38,8 @@ export const PrevNext = ({ slug, noPrev = false }) => {
|
|||
// Lookup the current slug in the LUT
|
||||
const index = slugLut.indexOf(slug)
|
||||
|
||||
if (index < 0) return null
|
||||
|
||||
// Add 1 for the next page, unless it's the last page
|
||||
const iNext = index === slugLut.length - 1 ? 0 : index + 1
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ export const CuratedSetPicker = ({ design, language, href, clickHandler }) => {
|
|||
const setTags = []
|
||||
for (const lang of siteConfig.languages) {
|
||||
const key = `tags${capitalize(lang)}`
|
||||
setTags.push(...set[key])
|
||||
if (set[key]) setTags.push(...set[key])
|
||||
}
|
||||
let match = 0
|
||||
for (const tag of filter) {
|
||||
|
|
|
@ -73,7 +73,7 @@ export const DesignOptions = ({
|
|||
const menuNs = [`o_${design}`, ...ns]
|
||||
const optionsMenu = optionsMenuStructure(patternConfig.options)
|
||||
const getDocsPath = (option) =>
|
||||
`patterns/${design}/options${option ? '/' + option.toLowerCase() : ''}`
|
||||
`designs/${design}/options${option ? '/' + option.toLowerCase() : ''}`
|
||||
|
||||
return (
|
||||
<WorkbenchMenu
|
||||
|
|
|
@ -55,16 +55,13 @@ export const PageWrapper = (props) => {
|
|||
* Update navigation context with title and path
|
||||
*/
|
||||
useEffect(() => {
|
||||
// Only update if a new page was loaded
|
||||
if (path.join('/') !== slug) {
|
||||
setNavigation({
|
||||
title: pageTitle,
|
||||
locale,
|
||||
path,
|
||||
})
|
||||
setNavupdates(navupdates + 1)
|
||||
}
|
||||
}, [path, pageTitle, slug, locale, navupdates, setNavigation])
|
||||
setNavupdates((curState) => curState + 1)
|
||||
}, [path, pageTitle, locale, setNavupdates, setNavigation])
|
||||
|
||||
/*
|
||||
* Hotkeys (keyboard actions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue