chore: Port FreeSewing.dev to docusaurus
The replaces the NextJS site powering FreeSewing.dev with a Docusaurus setup. It's part of my efforts to simplify FreeSewing's setup so we can focus on our core value proposition.
This commit is contained in:
parent
497633d1d3
commit
ab3204f9f1
692 changed files with 11037 additions and 20674 deletions
37
sites/dev/docs/howtos/code/shared-dimensions/readme.mdx
Normal file
37
sites/dev/docs/howtos/code/shared-dimensions/readme.mdx
Normal file
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
title: Share dimensions between pattern parts
|
||||
---
|
||||
|
||||
When you have different pattern parts that look similar -- like the front
|
||||
and back of a garment -- you may find that there's a lot of dimensions
|
||||
shared between them.
|
||||
|
||||
The example below is from Aaron where dimensions are shared between
|
||||
the back and front part.
|
||||
|
||||
Aaron has a file called `shared.mjs` that looks like this:
|
||||
|
||||
```js
|
||||
export function dimensions(macro, points, sa) {
|
||||
macro('hd', {
|
||||
from: points.cfHem,
|
||||
to: points.hem,
|
||||
y: points.hem.y + sa * 2.5 + 15
|
||||
})
|
||||
// more dimensions here
|
||||
}
|
||||
```
|
||||
|
||||
In both `front.mjs` and `back.mjs` we use this code to add these shared
|
||||
dimensions:
|
||||
|
||||
```js
|
||||
import { dimensions } from './shared'
|
||||
|
||||
// ...
|
||||
|
||||
if (paperless) {
|
||||
dimensions(macro, points, sa)
|
||||
// ... dimensions specific to this part
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue