Skip to content

Commit

Permalink
docs: add example to base tip in deploying (#994)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd authored Jul 15, 2022
1 parent 0826944 commit 97dee82
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions docs/guide/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The following guides are based on some shared assumptions:

If your site is to be served at a subdirectory (`https://example.com/subdir/`), then you have to set `'/subdir/'` as the [`base`](../config/app-configs#base) in your `docs/.vitepress/config.js`.

**Example:** If you're using Github (or GitLab) Pages and deploying to `user.github.io/repo/`, then set your `base` to `/repo/`.

:::

## Build and Test Locally
Expand Down Expand Up @@ -108,15 +110,9 @@ Don't enable options like _Auto Minify_ for HTML code. It will remove comments f

### Using GitLab CI

1. Set the correct `base` in `docs/.vitepress/config.js`.

If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/`, you can omit `base` as it defaults to `'/'`.

If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/<REPO>/` (your repository is at `https://gitlab.com/<USERNAME>/<REPO>`), then set `base` to `'/<REPO>/'`.

2. Set `outDir` in `docs/.vitepress/config.js` to `../public`.
1. Set `outDir` in `docs/.vitepress/config.js` to `../public`.

3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content:
2. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content:

```yaml
image: node:16
Expand Down

0 comments on commit 97dee82

Please sign in to comment.