Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d3f2cf

Browse files
committed
docs: add open in coder
This adds new documentation for the "Open in Coder" button that admins can use to get their developers up and running faster.
1 parent 5e2efb6 commit 6d3f2cf

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

docs/admin/open-in-coder.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Open in Coder Button
2+
3+
Add a markdown button to your project's `README.md` to get your developers up and running with Coder with a few clicks.
4+
5+
A basic example looks like this:
6+
7+
```text
8+
[![Open in Coder](https://cdn.coder.com/embed-button.svg)](https://dev.coder.com/?template=coder-ts)
9+
```
10+
11+
which renders like this:
12+
13+
![Open in Coder](https://cdn.coder.com/embed-button.svg)
14+
15+
You can customize this to take developers directly to your team's template. Read on to learn more.
16+
17+
### Customization
18+
19+
The underlying link for this button consists of the following pieces:
20+
- <deployment-url>: where your Coder deployment lives i.e. https://dev.coder.com
21+
- <query-params>: optional query parameters to customize the experience
22+
23+
These are the following query parameters we support:
24+
25+
### template
26+
27+
A template to redirect your developers to after they authenticate on your deployment.
28+
29+
Example: https://dev.coder.com/?template=coder-ts

docs/manifest.json

+5
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@
188188
"title": "Enterprise",
189189
"description": "Learn how to enable Enterprise features.",
190190
"path": "./admin/enterprise.md"
191+
},
192+
{
193+
"title": "Open in Coder Button",
194+
"description": "Learn how to create an 'Open in Coder' button.",
195+
"path": "./admin/open-in-coder.md"
191196
}
192197
]
193198
},

site/src/pages/index.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { FC } from "react"
2-
import { Navigate } from "react-router-dom"
2+
import { Navigate, useSearchParams } from "react-router-dom"
33

44
export const IndexPage: FC = () => {
5+
const [searchParams, _] = useSearchParams()
6+
const template = searchParams.get("template")
7+
8+
if (template) {
9+
return <Navigate to={`/templates/${template}`} replace />
10+
}
11+
512
return <Navigate to="/workspaces" replace />
613
}

0 commit comments

Comments
 (0)