Skip to content

Commit 30a7277

Browse files
Ayc0Haroenv
andauthored
Improve documentation's flow (#855)
* [gatsby] reorder sections to put examples 1st * [gatsby] put TL;DR before explanations * PR nits Co-Authored-By: Haroen Viaene <[email protected]> Co-authored-by: Haroen Viaene <[email protected]>
1 parent 456ad5e commit 30a7277

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

packages/gatsby/content/advanced/questions-and-answers.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,14 @@ Lockfiles should **always** be kept within the repository. Continuous integratio
4646

4747
## Which files should be gitignored?
4848

49-
- `.yarn/plugins` and `.yarn/releases` contain the Yarn releases used in the current repository (as defined by [`yarn set version`](/cli/set/version)). You will want to keep them versioned (this prevents potential issues if, say, two engineers use different Yarn versions with different features).
50-
51-
- `.yarn/unplugged` and `.yarn/build-state.yml` should likely always be ignored since they typically hold machine-specific build artifacts. Ignoring them might however prevent [Zero-Installs](https://next.yarnpkg.com/features/zero-installs) from working (to prevent this, set [`enableScripts`](/configuration/yarnrc#enableScripts) to `false`).
52-
53-
- `.yarn/versions` is used by the [version plugin](/features/release-workflow) to store the package release definitions. You will want to keep it within your repository.
54-
55-
- `.yarn/cache` and `.pnp.*` may be safely ignored, but you'll need to run `yarn install` to regenerate them between each branch switch - which would be optional otherwise, cf [Zero-Installs](/features/zero-installs).
56-
57-
- `yarn.lock` should always be stored within your repository ([even if you develop a library](#should-lockfiles-be-committed-to-the-repository)).
58-
59-
- `.yarnrc.yml` (and its older counterpart, `.yarnrc`) are configuration files. They should always be stored in your project.
60-
61-
So to summarize:
62-
63-
**If you're using Zero-Installs:**
49+
If you're using Zero-Installs:
6450

6551
```gitignore
6652
.yarn/unplugged
6753
.yarn/build-state.yml
6854
```
6955

70-
**If you're not using Zero-Installs:**
56+
If you're not using Zero-Installs:
7157

7258
```gitignore
7359
.yarn/cache
@@ -76,3 +62,16 @@ So to summarize:
7662
.pnp.*
7763
```
7864

65+
### Details
66+
67+
- `.yarn/unplugged` and `.yarn/build-state.yml` should likely always be ignored since they typically hold machine-specific build artifacts. Ignoring them might however prevent [Zero-Installs](https://next.yarnpkg.com/features/zero-installs) from working (to prevent this, set [`enableScripts`](/configuration/yarnrc#enableScripts) to `false`).
68+
69+
- `.yarn/cache` and `.pnp.*` may be safely ignored, but you'll need to run `yarn install` to regenerate them between each branch switch - which would be optional otherwise, cf [Zero-Installs](/features/zero-installs).
70+
71+
- `.yarn/plugins` and `.yarn/releases` contain the Yarn releases used in the current repository (as defined by [`yarn set version`](/cli/set/version)). You will want to keep them versioned (this prevents potential issues if, say, two engineers use different Yarn versions with different features).
72+
73+
- `.yarn/versions` is used by the [version plugin](/features/release-workflow) to store the package release definitions. You will want to keep it within your repository.
74+
75+
- `yarn.lock` should always be stored within your repository ([even if you develop a library](#should-lockfiles-be-committed-to-the-repository)).
76+
77+
- `.yarnrc.yml` (and its older counterpart, `.yarnrc`) are configuration files. They should always be stored in your project.

packages/gatsby/gatsby-plugin-clipanion-cli/gatsby-node.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ exports.sourceNodes = ({actions, createNodeId, createContentDigest}, opts) => {
3232
`\`\`\`\n`,
3333
].join(``));
3434

35-
if (command.details) {
36-
sections.push([
37-
`## Details\n`,
38-
`\n`,
39-
`${command.details}\n`,
40-
].join(``));
41-
}
42-
4335
if (command.examples && command.examples.length > 0) {
4436
sections.push([
4537
`## Examples\n`,
@@ -53,6 +45,15 @@ exports.sourceNodes = ({actions, createNodeId, createContentDigest}, opts) => {
5345
].join(``));
5446
}
5547

48+
if (command.details) {
49+
sections.push([
50+
`## Details\n`,
51+
`\n`,
52+
`${command.details}\n`,
53+
].join(``));
54+
}
55+
56+
5657
const content = sections.join(`\n`);
5758
const contentDigest = createContentDigest(content);
5859

0 commit comments

Comments
 (0)