Skip to content

Commit 06ffff4

Browse files
README: fix component list, document preview frontmatter and PR checks
- Replace the component list: <ProductLinks> never existed; list what src/components/MdxComponents.tsx actually registers, with props - Add the preview frontmatter field - Add a Pull request checks section for the links, redirects, spelling and preview-links workflows - Drop the stale reviewer handle and 'this template' wording Amp-Thread-ID: https://ampcode.com/threads/T-01a0ad56-bd79-73ce-bc8e-a5405d0c11f2 Co-authored-by: Amp <amp@ampcode.com>
1 parent 4bb9921 commit 06ffff4

1 file changed

Lines changed: 51 additions & 20 deletions

File tree

‎README.md‎

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ documentation.
1111

1212
## Get started
1313

14-
To get started with this template, clone this repository to your local machine
15-
using the following command:
14+
Clone this repository to your local machine using the following command:
1615

1716
```sh
1817
git clone https://github.com/sourcegraph/docs.git docs
@@ -73,8 +72,7 @@ All you need to do is:
7372
5. Provide a Commit message and an Extended description.
7473
6. Click on the green "Propose changes" button to create a PR.
7574
7. Add a PR reviewer to the Reviewers panel by clicking on the gear icon.
76-
8. Tag `@maedahbatool` in the `#docs` Slack channel and link to your PR to get
77-
a quick review.
75+
8. Post a link to your PR in the `#docs` Slack channel to get a quick review.
7876
> NOTE: "Edit from GitHub" is generally recommended for text-based edits.
7977
> For more structural-based contributions like adding React components and
8078
> code blocks, it's always better to go with a local setup. This way, you
@@ -109,6 +107,7 @@ metadata. Here are the supported fields:
109107
| `title` | string | No | The page title |
110108
| `date` | date | No | Last modified date (used in sitemap) |
111109
| `seoPriority` | number | No | Sitemap priority 0.0–1.0, default 0.5 |
110+
| `preview` | bool | No | Hidden; 404 without `?preview` query |
112111

113112
Example:
114113

@@ -151,29 +150,46 @@ We have a set of reusable React components located in the `src/components`
151150
directory. These components are designed to enhance the user experience and
152151
maintain consistency across our documentation.
153152

154-
For example the cards layout appears by using the `<Callout>` component that
155-
can add `note`, `info`, or `warning` notices in docs.
156-
157-
![Callout components rendered in the docs](https://storage.googleapis.com/sourcegraph-assets/Docs/CleanShot%202023-12-12%20at%2012.00.29%402x.png)
158-
159-
You can use this component within your content as follows:
153+
For example, `<Callout>` adds a `note`, `info`, `tip`, or `warning` notice:
160154

161155
```js
162156
<Callout type="note">This feature is currently in Beta for all users.</Callout>
163157
```
164158

165-
This snippet creates a single `<QuickLink>` titled as "Get Cody". You can add
166-
as many cards you want while filling out all the relevant details.
167-
168-
Here are the list of all the supported components we have:
159+
![Callout components rendered in the docs](https://storage.googleapis.com/sourcegraph-assets/Docs/CleanShot%202023-12-12%20at%2012.00.29%402x.png)
169160

170-
- `<QuickLinks>`
171-
- `<ProductLinks>`
172-
- `<LinkCards>`
173-
- `<Callout>`
161+
The components available in MDX are registered in
162+
`src/components/MdxComponents.tsx`:
163+
164+
| Component | Use |
165+
| -------------------------- | ----------------------------------------------- |
166+
| `<Callout>` | `type`: `note`, `info`, `tip`, or `warning` |
167+
| `<TierCallout>` | Which plan or tier a feature needs |
168+
| `<QuickLinks>` | Card grid; `<QuickLink>` takes `title`, |
169+
| | `description`, `href`, `icon` |
170+
| `<LinkCards>` | Card grid with images; `<LinkCard>` adds |
171+
| | `imgSrc` and `imgAlt` |
172+
| `<ProductCards>` | `<ProductCard>` grid, same props as `LinkCard` |
173+
| `<Tabs>` | Tabbed content; `<Tab title="...">` |
174+
| `<Accordion title="...">` | Collapsible section |
175+
| `<Badge>` | Inline label |
176+
| `<SupportedReleasesTable>` | Release tables on `/releases`, also |
177+
| | `<DeprecatedReleasesTable>` |
178+
| `<ResourceEstimator>` | Page-specific widgets, also `<FeatureParity>` |
179+
| | and `<AWSOneClickLaunchForm>` |
180+
181+
For example:
174182

175-
For a better docs experience, we'll continue adding more components in the
176-
future.
183+
```js
184+
<QuickLinks>
185+
<QuickLink
186+
title="Terraform on AWS"
187+
icon="installation"
188+
href="/self-hosted/executors/deploy-executors-terraform-aws"
189+
description="Deploy executors on AWS with Terraform."
190+
/>
191+
</QuickLinks>
192+
```
177193

178194
### Adding a link
179195

@@ -228,6 +244,21 @@ Once you're satisfied with your changes, follow these steps:
228244
[Sourcegraph documentation repository](https://github.com/sourcegraph/docs),
229245
and tag the appropriate reviewers.
230246

247+
### Pull request checks
248+
249+
GitHub Actions comment on your PR with anything it introduces:
250+
251+
- **Broken links**: internal links and `#anchors` that no longer resolve,
252+
absolute links to this site, and external links that 404. This check fails
253+
the PR. Locally: `pnpm run check links --check-anchors --check-self-links`.
254+
- **Broken redirects**: entries in `src/data/redirects.ts` whose destination
255+
no longer exists. Locally: `node dev/check-redirects.mjs`.
256+
- **Spelling**: CSpell on the lines you added, plus the PR title and
257+
description. Advisory only. Add product names and identifiers to
258+
`cspell-allow-list.txt`, in alphabetical order.
259+
- **Preview links**: direct links to the pages you changed on the Vercel
260+
preview deployment, once it finishes.
261+
231262
Thank you for contributing to Sourcegraph documentation! Your efforts help us
232263
provide top-notch learning experiences for our users. If you have any questions
233264
or need assistance, feel free to reach out.

0 commit comments

Comments
 (0)