Skip to content

Commit 02a7642

Browse files
JZ LohJZ Loh
authored andcommitted
add VERCEL support
1 parent 5bb3920 commit 02a7642

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

docusaurus.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type * as Preset from '@docusaurus/preset-classic';
44

55
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
66

7+
const isProd = process.env.VERCEL === '1';
78
const config: Config = {
89
title: 'JZ Loh\'s notebook',
910
tagline: 'Embeded notebook',
@@ -16,10 +17,10 @@ const config: Config = {
1617
},
1718

1819
// Set the production url of your site here
19-
url: 'https://bitshelf.github.io',
20+
url: isProd ? 'https://bitshelf.github.io': 'https://docs-rose-pi-94.vercel.app/',
2021
// Set the /<baseUrl>/ pathname under which your site is served
2122
// For GitHub pages deployment, it is often '/<projectName>/'
22-
baseUrl: '/docs/',
23+
baseUrl: isProd ? '/' : '/docs/',
2324

2425
// GitHub pages deployment config.
2526
// If you aren't using GitHub pages, you don't need these.

src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function HomepageHeader() {
2020
<div className={styles.buttons}>
2121
<Link
2222
className="button button--secondary button--lg"
23-
to="/docs">
23+
to="/">
2424
Embeded notebook Tutorial⏱️
2525
</Link>
2626
</div>

0 commit comments

Comments
 (0)