1
0
Fork 0

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:
Joost De Cock 2024-09-28 13:13:48 +02:00
parent 497633d1d3
commit ab3204f9f1
692 changed files with 11037 additions and 20674 deletions

View file

@ -0,0 +1,17 @@
---
title: Change your commit message for the most recent commit
---
If you've made a typo or have another reason why you'd like to
change the most recent commit message, you run this command:
```bash
git commit --amend
```
If you run it like this, it will spin up your predefined editor.
To specify the updated commit message on the command line, run:
```bash
git commit --amend -m "This is my improved commit message"
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View file

@ -0,0 +1,102 @@
---
title: Editing FreeSewing content on GitHub
---
## Introduction
This 'How to' is designed to help get you started editing content using the
[GitHub website](https://github.com/freesewing).
GitHub stores a lot of FreeSewing content, it allows anyone to suggest
edits, and helps the contributors to review and implement approved changes.
If you are new to GitHub, you will need to [create an
account](https://github.com/signup?user_email=\&source=form-home-signup)
(they are free).
:::note
It is also possible to make changes using the GitHub desktop
application and/or your computer's command line; these advanced topics are
beyond the scope of this 'How to'.
:::
All pattern instructions and web pages (including this 'How to') are written in
_Markdown_. Please see our [Markdown
guide](https://freesewing.dev/guides/markdown) for more information on this.
For security, most contributors don't have permission to change the code.
Instead we must follow three steps to make edits:
1. [_Fork_ (create a copy of) the repository](#fork-the-repository). This will
be your own copy and you can make all the changes you want.
2. [Make the edits](#make-the-edits).
3. [Save your edits and submit a _pull
request_](#save-your-edits-and-submit-a-pull-request) to let the admins know
about your changes. This says _"hey, I made some changes. I think you might
like them and consider them for inclusion into your (original) repository."_
The GitHub documentation provides a more [detailed
explanation](https://docs.github.com/en/get-started/quickstart/fork-a-repo),
but this guide should be enough to help you get started.
## Fork the repository
- On GitHub.com, navigate to the FreeSewing
[repository](https://github.com/freesewing/freesewing)
- In the top-right corner of the page, click **Fork**
![Fork button](fork_button.png)
- Click the **Create fork** button.
![Create fork button](fork-create-button.png)
## Make the edits
- Navigate to the folder containing the file that you want to edit.
To help you understand how the repository is organised, here is the path to the
Simone instructions:
`freesewing/markdown/org/docs/patterns/simone/instructions` This folder
contains several files, one for each language.
![Path to Simone instructions](simone-instructions-path.png)
- Select on the file you want to update.
:::warning
Please only edit the English language files (called `en.md`),
our translation software will handle the other languages.
:::
- Click on the **Edit** button.
![edit button image](edit-button.png)
:::note
Clicking **Preview** will show what your changes will look like.
![Edit and preview buttons](edit-preview-buttons.png)
:::
## Save your edits and submit a pull request
When you are happy with your edits:
- Scroll to the bottom of the page and enter a brief description of your edits.
This will help us know what has changed.
- Click the **Commit changes** button. This is similar to saving a snapshot of
your edits.
![Commit changes](commit-changes.png)
Now you will create a _pull request_ to let the admins know your edits are
ready for review:
- Navigate to the repository where you created your fork.
- Above the list of files, click the **Pull request** button.
![Pull request button](pull-request-button.png)
Congratulations - you have just submitted your first edits to the site
maintainers!
You can keep track of the progress of your changes in GitHub or in the
[github-updates
channel](https://discord.com/channels/698854858052075530/836689608820916234) on
our Discord server.
![github updates channel image](discord-github-updates.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -0,0 +1,26 @@
---
title: Common git challenges
---
Git is a distributed version control system originally created by
Linus Torvalds (of Linux fame).
Much like Linux itself, git is immensely powerful yet can be intimidating
at first.
Below are some common challenges when working with FreeSewing code in git:
<ReadMore recurse />
:::tip
##### Git what now?
If you've never heard of git, if you're not even sure what a version
control system is, I recommend
this [Learn Git in 15 Minutes](https://www.youtube.com/watch?v=USjZcfj8yxE&) introduction video.
If you've used git before, but always felt confused about how it works,
check out this [Git For Ages 4 And Up](https://youtu.be/1ffBJ4sVUb4?t=121) video.
A bit longer, but it well worth a watch.
:::

View file

@ -0,0 +1,103 @@
---
title: Save often, then rewrite history like a boss
---
Git keeps track of everything so if we commit often
we have the possibility to go back to a previous commit
whenever we mess up somehow.
The downside is that now we've got a bunch of commits that
detail it took us 12 attempts to get it right and they might also
have commit message that are [not so great][1].
No need to worry, even the best among do these quick saves without
spending much time to write a meaningful commit message:
```bash
git add . && git commit -m "save"
```
The way you can get the best of both worlds is by _rewriting history_.
Save as many times you want, and when you've gotten to the point where
you feel like you've hit a good milestone, roll them all back and commit
anew with a nice commit message that makes it seem you had it all figured
out in one commit.
## Rolling back history
Before we roll back history, we need to figure out how many quick-save-commits
we did. Run the following command to bring up the commit log:
```bash
git log
```
Below is example output:
```txt
commit 7f5be3eb8612e5cd5be80532c46514d679a6cd58 (HEAD -> develop)
Author: Joost De Cock <joost@joost.at>
Date: Sun Jan 16 17:06:01 2022 +0100
spoke too soon, now it's ok
commit 67c6bc266912c5088f3211346602ba07d5754eae
Author: Joost De Cock <joost@joost.at>
Date: Sun Jan 16 17:05:47 2022 +0100
think I've got it
commit da62f7acca413a28235c72290a939f36ccd77cae
Author: Joost De Cock <joost@joost.at>
Date: Sun Jan 16 17:05:20 2022 +0100
another save
commit f217f3c4f9cd23f2033eab4d9cd98e9506b86641
Author: Joost De Cock <joost@joost.at>
Date: Sun Jan 16 17:05:07 2022 +0100
save
commit 5e26513da4c622abcaa2724e675cee5f3e9a2f87
Merge: cf961b039e 7e72569567
Author: Joost De Cock <joost@joost.at>
Date: Sun Jan 16 13:48:15 2022 +0100
Merge branch 'develop' of github.com:freesewing/freesewing into develop
```
As you can see, there's **4** commits that make up our recent work.
To roll back history and go back 4 commits, run this command:
```bash
git reset --soft HEAD~4
```
:::tip
The `4` in the command above should be updated if you want to
roll back more or less commits.
:::
After this command, the output of `git log` will now no longer include
our hasty commits:
```txt
commit 5e26513da4c622abcaa2724e675cee5f3e9a2f87 (HEAD -> develop)
Merge: cf961b039e 7e72569567
Author: Joost De Cock <joost@joost.at>
Date: Sun Jan 16 13:48:15 2022 +0100
Merge branch 'develop' of github.com:freesewing/freesewing into develop
```
Instead, all the previous changes are now staged, and we can do a new commit,
and rewrite our for quick-save commits into one commit that only commits the
end result of our repeated attempts.
This approach keeps the commit history clean, not to mention that it makes
you look like a total boss who gets everything right at the first attempt.
[1]: https://github.com/freesewing/freesewing/commit/5204ff5c16327962108e1629716e045275d3bf84