Skip to content

Commit 36ad36a

Browse files
update contributing docs (#9061)
1 parent aa0d047 commit 36ad36a

File tree

4 files changed

+49
-17
lines changed

4 files changed

+49
-17
lines changed

docs/contributing/environment.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ make
2626
Now run the development webserver:
2727

2828
```bash
29-
yarn start
29+
yarn dev
3030
```
3131

3232
You will now be able to access docs via http://localhost:3000.

docs/contributing/linking.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,13 @@ This type of link can be used also for linking to anchors on external pages:
9595

9696
## Images
9797

98-
All images must live in the `/public/` folder in order to be processed correctly.
98+
All images live in the `/public/` folder. You can reference images in this folder by using its full path (minus `/public/`).
9999

100-
The folder structure of `/docs/` is duplicated in `/public/` so that you can still use relative paths to reference images in your content files. For instance, files (such as `index.mdx`) in the `/docs/platforms/android/enriching-events/attachments/` folder can reference images (such as `attachments-access.png`) living in the `/public/platforms/android/enriching-events/attachments/` folder like this:
100+
For instance, to use the image, `/public/product/alerts/issue-alert.png`, in any file:
101101

102-
`![Attachments Access](attachments-access.png)`
102+
`![Image alt text](product/alerts/issue-alert.png)`
103103

104-
Content files that live elsewhere (such as `/docs/product/accounts/quotas/manage-attachments-quota.mdx`) can still use the same image by referencing it like so (`/public` does not need to be included in the path):
105-
106-
`![Attachments Access](/platforms/android/enriching-events/attachments/attachments-acccess.png)`
104+
The folder structure of `docs` is duplicated in `public` so that you can still use relative paths to reference images in your content files. For more details, see [Images](/contributing/pages/images).
107105

108106
## Email address
109107

docs/contributing/pages/images.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Images
3+
noindex: true
4+
---
5+
6+
All images must live in the [`public`](https://github.com/getsentry/sentry-docs/tree/master/public) folder in order to be processed correctly.
7+
8+
The folder structure of `docs` is duplicated in `public` so that you can still use relative paths to reference images in your content files.
9+
10+
For instance, the file, `docs/product/alerts/alert-types.mdx`, can reference the image, `public/product/alerts/issue-alert.png`, like so :
11+
12+
```markdown {filename:docs/product/alerts/alert-types.mdx}
13+
![Issue alert](issue-alert.png)
14+
```
15+
16+
Content files that live elsewhere (such as `/docs/platform/apple/index.mdx`) can still use the same image by referencing it with the full path (`/public` does not need to be included), like so:
17+
18+
```markdown {filename:/docs/platform/apple/index.mdx}
19+
![Issue alert](/product/alerts/issue-alert.png)
20+
```

docs/contributing/pages/redirects.mdx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,31 @@ title: Redirects
33
noindex: true
44
---
55

6-
Redirects are supported via yaml frontmatter in `.md` and `.mdx` files:
76

8-
```yaml
9-
---
10-
redirect_from:
11-
- /performance-monitoring/discover/
12-
---
13-
```
7+
Redirects allow you to automatically redirect an incoming request path to a new destination path. When you move or rename a file, you should make sure to set up a redirect from the old path to the new path, so that the old URL still takes users to the right place.
8+
9+
## Add a New Redirect
1410

15-
These will be generated as both client-side (using an empty page with a meta tag) and server-side (nginx rules).
11+
Redirects are configured in [`next.config.js`](https://github.com/getsentry/sentry-docs/blob/master/next.config.js) and are checked before the filesystem (including pages and `/public` files ). The `redirects` function returns an array holding redirect objects.
1612

17-
## Vercel
13+
To add a new redirect, add a new object in the redirects array with the following properties:
1814

19-
Because docs.sentry.io is hosted on Vercel, there are also some wider-reaching redirects implemented to cover legacy URLs which cannot be re-implemented using `redirect_from`. See `vercel.json` for these.
15+
- `source`: The incoming request path pattern.
16+
- `destination`: The new destination path you want to route to instead.
17+
- `permanent`: Whether the redirect is permanent and should be cached forever (`true`) or is temporary (`false`).
18+
19+
### Example Redirect
20+
21+
The example below adds a redirect for the alerts page after its parent folder was renamed from `alerts-notifications` to `alerts`.
22+
23+
```javascript {filename:next.config.js}
24+
redirects() {
25+
return [
26+
{
27+
source: '/product/alerts-notifications/',
28+
destination: '/product/alerts/',
29+
permanent: true,
30+
},
31+
]
32+
}
33+
```

0 commit comments

Comments
 (0)