Skip to content

Commit 2a16f90

Browse files
committed
docs: fix code block
1 parent 5975984 commit 2a16f90

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/custom-domains.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
You can have the documentation site hosted on a custom domain with help of rewrites
22

33
<Callout type='warning'>
4-
This feature still has a slight disadvantage - it's not possible to have `customdomain.com/docs/` yet. Instead one can have `customdomain.com/<slug>/docs`
4+
This feature still has a slight disadvantage - it's not possible to have **customdomain.com/docs/** yet. Instead one can have **customdomain.com/SLUG/docs**
55
</Callout>
66

7+
Replace all `SLUG`s here with the one you created while creating site in hyperdocs dashboard
8+
79
We can use any service to rewrite all the routes to our documentation site from the custom domain.
810

911
Let's use Vercel here
1012

1113
- Create a new repo
1214
- Add your custom domain/subdomain to that repo
1315
- Add a `vercel.json` file with the following content:
14-
`json { "$schema": "https://openapi.vercel.sh/vercel.json", "rewrites": [ { "source": "/", "destination": "https://hyperdocs.netlify.app/SLUG" }, { "source": "/:path*", "destination": "https://hyperdocs.netlify.app/:path*" } ] } `
16+
17+
```json
18+
{
19+
"$schema": "https://openapi.vercel.sh/vercel.json",
20+
"rewrites": [
21+
{ "source": "/", "destination": "https://hyperdocs.netlify.app/SLUG" },
22+
{
23+
"source": "/:path*",
24+
"destination": "https://hyperdocs.netlify.app/:path*"
25+
}
26+
]
27+
}
28+
```
1529

1630
Now you can access the website from your custom domain.
1731

0 commit comments

Comments
 (0)