docs: update links (#523)

* docs: update links

* docs: fix 3xx urls

* chore: fix typo
pull/545/head
Divyansh Singh 2 years ago committed by GitHub
parent 779b78902f
commit 33a59cd029
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
name: "\U0001F41E Bug report"
description: Create a report to help us improve
labels: ["bug: pending triage"]
labels: ['bug: pending triage']
body:
- type: markdown
attributes:
@ -52,9 +52,9 @@ body:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Follow our [Code of Conduct](https://vuejs.org/coc)
- label: Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
required: true
- label: Read the [docs](https://vitepress.vuejs.org/).
- label: Read the [docs](https://vitepress.vuejs.org).
required: true
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
required: true

@ -35,11 +35,11 @@ body:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Follow our [Code of Conduct](https://vuejs.org/coc)
- label: Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
required: true
- label: Read the [docs](https://vitepress.vuejs.org/).
- label: Read the [docs](https://vitepress.vuejs.org).
required: true
- label: Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/master/.github/contributing.md).
- label: Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).
required: true
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- label: Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
required: true

@ -6,7 +6,7 @@
Messages must be matched by the following regex:
``` js
```js
/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,50}/
```
@ -44,7 +44,7 @@ This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
### Full Message Format
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
```
<type>(<scope>): <subject>
@ -74,9 +74,9 @@ The scope could be anything specifying the place of the commit change. For examp
The subject contains a succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize the first letter
* no dot (.) at the end
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
### Body

@ -19,11 +19,11 @@ Hi! We're really excited that you are interested in contributing to VitePress. B
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
- Commit messages must follow the [commit message convention](./commit-convention.md) so that changelogs can be automatically generated.
- Commit messages must follow the [commit message convention](./commit-convention) so that changelogs can be automatically generated.
## Development Setup
You will need [pnpm](https://pnpm.io/)
You will need [pnpm](https://pnpm.io)
After cloning the repo, run:

@ -21,7 +21,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: "pnpm"
cache: 'pnpm'
- name: Install deps
run: pnpm install

@ -5,7 +5,7 @@
---
VitePress is [VuePress](http://vuepress.vuejs.org/)' spiritual successor, built on top of [vite](https://github.com/vuejs/vite).
VitePress is [VuePress](https://vuepress.vuejs.org)' spiritual successor, built on top of [vite](https://github.com/vitejs/vite).
## Documentation
@ -13,14 +13,14 @@ To check out docs, visit [vitepress.vuejs.org](https://vitepress.vuejs.org).
## Changelog
Detailed changes for each release are documented in the [CHANGELOG](https://github.com/vuejs/vitepress/blob/master/CHANGELOG.md).
Detailed changes for each release are documented in the [CHANGELOG](./CHANGELOG).
## Contribution
Please make sure to read the [Contributing Guide](./.github/contributing.md) before making a pull request.
Please make sure to read the [Contributing Guide](./.github/contributing) before making a pull request.
## License
[MIT](https://opensource.org/licenses/MIT)
[MIT](./LICENSE)
Copyright (c) 2019-present, Yuxi (Evan) You

@ -1,3 +1,3 @@
<template>
<span>&#x26A1;</span>
</template>
</template>

@ -1,6 +1,6 @@
# Theme Config: Algolia Search
The `themeConfig.algolia` option allows you to use [Algolia DocSearch](https://docsearch.algolia.com/). To enable it, you need to provide at least apiKey and indexName:
The `themeConfig.algolia` option allows you to use [Algolia DocSearch](https://docsearch.algolia.com). To enable it, you need to provide at least apiKey and indexName:
```js
module.exports = {
@ -13,7 +13,7 @@ module.exports = {
}
```
For more options, check out [Algolia DocSearch's documentation](https://docsearch.algolia.com/docs/behavior). You can pass any extra option alongside other options, e.g. passing `searchParameters`:
For more options, check out [Algolia DocSearch's documentation](https://docsearch.algolia.com/docs/api/). You can pass any extra option alongside other options, e.g. passing `searchParameters`:
```js
module.exports = {

@ -1,7 +1,7 @@
# App Config: Basics
::: tip
The config reference is incomplete since the config format may still receive further changes. For a complete reference of the current available options, refer to [config.ts](https://github.com/vuejs/vitepress/blob/master/src/node/config.ts#L15).
The config reference is incomplete since the config format may still receive further changes. For a complete reference of the current available options, refer to [config.ts](https://github.com/vuejs/vitepress/blob/45b65ce8b63bd54f345bfc3383eb2416b6769dc9/src/node/config.ts#L30-L65).
:::
## base

@ -20,5 +20,4 @@ features:
details: VitePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.
footer: MIT Licensed | Copyright © 2019-present Evan You
---
```

@ -4,7 +4,7 @@
The following methods are globally importable from `vitepress` and are typically used in custom theme Vue components. However, they are also usable inside `.md` pages because markdown files are compiled into Vue single-file components.
Methods that start with `use*` indicates that it is a [Vue 3 Composition API](https://v3.vuejs.org/guide/composition-api-introduction.html) function that can only be used inside `setup()` or `<script setup>`.
Methods that start with `use*` indicates that it is a [Vue 3 Composition API](https://vuejs.org/guide/introduction.html#composition-api) function that can only be used inside `setup()` or `<script setup>`.
### `useData`
@ -63,7 +63,7 @@ interface Router {
- **Type**: `(path: string) => string`
Appends the configured [`base`](/config/basics.html#base) to a given URL path. Also see [Base URL](/guide/assets.html#base-url).
Appends the configured [`base`](../config/basics#base) to a given URL path. Also see [Base URL](./assets#base-url).
## Global Components
@ -71,7 +71,7 @@ VitePress comes with few built-in component that can be used globally. You may u
### `<Content/>`
The `<Content/>` component displays the rendered markdown contents. Useful [when creating your own theme](https://vitepress.vuejs.org/guide/customization.html).
The `<Content/>` component displays the rendered markdown contents. Useful [when creating your own theme](./theming).
```vue
<template>

@ -40,7 +40,7 @@ However, if you are authoring a theme component that links to assets dynamically
<img :src="theme.logoPath" />
```
In this case it is recommended to wrap the path with the [`withBase` helper](/guide/api.html#withbase) provided by VitePress:
In this case it is recommended to wrap the path with the [`withBase` helper](./api#withbase) provided by VitePress:
```vue
<script setup>

@ -22,7 +22,7 @@ module.exports = {
}
```
Check out the [Config Reference](/config/basics) for a full list of options.
Check out the [Config Reference](../config/basics) for a full list of options.
## Config Intellisense

@ -82,10 +82,10 @@ git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git main
# if you are deploying to https://<USERNAME>.github.io/<REPO>
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
# git push -f git@github.com:<USERNAME>/<REPO>.git main:gh-pages
cd -
```
@ -106,7 +106,7 @@ You can also run the above script in your CI setup to enable automatic deploymen
3. Run `yarn` or `npm install` locally and commit the generated lockfile (that is `yarn.lock` or `package-lock.json`).
4. Use the GitHub Pages deploy provider template, and follow the [Travis CI documentation](https://docs.travis-ci.com/user/deployment/pages/).
4. Use the GitHub Pages deploy provider template, and follow the [Travis CI documentation](https://docs.travis-ci.com/user/deployment/pages).
```yaml
language: node_js
@ -125,7 +125,7 @@ deploy:
github_token: $GITHUB_TOKEN
keep_history: true
on:
branch: master
branch: main
```
## GitLab Pages and GitLab CI
@ -153,12 +153,12 @@ pages:
paths:
- public
only:
- master
- main
```
## Netlify
1. On [Netlify](https://netlify.com), setup up a new project from GitHub with the following settings:
1. On [Netlify](https://www.netlify.com/), setup up a new project from GitHub with the following settings:
- **Build Command:** `vitepress build docs` or `yarn docs:build` or `npm run docs:build`
- **Publish directory:** `docs/.vitepress/dist`
@ -247,7 +247,7 @@ $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git
```bash
# publish site
$ git push heroku master
$ git push heroku main
# opens a browser to view the Dashboard version of Heroku CI
$ heroku open
@ -255,9 +255,9 @@ $ heroku open
## Vercel
To deploy your VitePress app with a [Vercel for Git](https://vercel.com/docs/git), make sure it has been pushed to a Git repository.
To deploy your VitePress app with a [Vercel for Git](https://vercel.com/docs/concepts/git), make sure it has been pushed to a Git repository.
Go to https://vercel.com/import/git and import the project into Vercel using your Git of choice (GitHub, GitLab or BitBucket). Follow the wizard to select the project root with the project's `package.json` and override the build step using `yarn docs:build` or `npm run docs:build` and the output dir to be `./docs/.vitepress/dist`
Go to https://vercel.com/new and import the project into Vercel using your Git of choice (GitHub, GitLab or BitBucket). Follow the wizard to select the project root with the project's `package.json` and override the build step using `yarn docs:build` or `npm run docs:build` and the output dir to be `./docs/.vitepress/dist`
![Override Vercel Configuration](../images/vercel-configuration.png)

@ -1,6 +1,7 @@
---
sidebarDepth: 2
---
# Differences from VuePress
VitePress and VuePress have different [design goals](../index.md). Both projects share similar config naming conventions. VitePress aims to have the bare minimum features needed for authoring docs. Other features are pushed to Themes. On the other hand, VuePress has more features out-of-the-box or enabled by its ecosystem of plugins.
@ -22,11 +23,11 @@ In case you decide to move your project to VitePress, this is a list of differen
- [Plugins](https://vuepress.vuejs.org/plugin/) support, features are implemented in themes
- [permalink support](https://vuepress.vuejs.org/guide/permalinks.html)
- `.vitepress/templates`
- Components in `.vitepress/components` [are not auto registered as global components](https://vuepress.vuejs.org/)
- Components in `.vitepress/components` [are not auto registered as global components](https://vuepress.vuejs.org)
- Differences
- [Public files](https://vuepress.vuejs.org/guide/assets.html#public-files) that are directly copied to dist root moved from `.vitepress/public/` is `public/`
- [styling](https://vuepress.vuejs.org/config/#styling) `.vitepress/styles/index.styl` and `.vitepress/styles/palette.styl` is not supported. See [Customizing CSS](/guide/theming.html#customizing-css).
- [App Level Enhancements](https://vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements) API, app enhancements `.vitepress/enhanceApp.js` is now done in `.vitepress/theme/index.js`. See [Extending the Default Theme](/guide/theming.html#extending-the-default-theme).
- [styling](https://vuepress.vuejs.org/config/#styling) `.vitepress/styles/index.styl` and `.vitepress/styles/palette.styl` is not supported. See [Customizing CSS](./theming#customizing-css).
- [App Level Enhancements](https://vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements) API, app enhancements `.vitepress/enhanceApp.js` is now done in `.vitepress/theme/index.js`. See [Extending the Default Theme](./theming#extending-the-default-theme).
## Markdown

@ -63,7 +63,6 @@ head:
- name: keywords
content: super duper SEO
---
```
### navbar

@ -4,7 +4,7 @@ VitePress comes with few built-in component that can be used globally. You may u
## Content
The `Content` component displays the rendered markdown contents. Useful [when creating your own theme](https://vitepress.vuejs.org/guide/customization.html).
The `Content` component displays the rendered markdown contents. Useful [when creating your own theme](./theming).
```vue
<template>
@ -30,4 +30,3 @@ If you are using or demoing components that are not SSR-friendly (for example, c
## OutboundLink
The indicator `OutboundLink` is used to denote external links. In VitePress, this component has been followed by every external link.

@ -53,7 +53,7 @@ Outbound links automatically get `target="_blank" rel="noopener noreferrer"`:
## Frontmatter
[YAML frontmatter](https://jekyllrb.com/docs/frontmatter/) is supported out of the box:
[YAML frontmatter](https://jekyllrb.com/docs/front-matter/) is supported out of the box:
```yaml
---
@ -64,7 +64,7 @@ lang: en-US
This data will be available to the rest of the page, along with all custom and theming components.
For more details, see [Frontmatter](./frontmatter.md).
For more details, see [Frontmatter](./frontmatter).
## GitHub-Style Tables
@ -176,9 +176,11 @@ Danger zone, do not proceed
:::
::: details Click me to view the code
```js
console.log('Hello, VitePress!')
```
:::
````
@ -189,14 +191,16 @@ Danger zone, do not proceed
:::
::: details Click me to view the code
```js
console.log('Hello, VitePress!')
```
:::
## Syntax Highlighting in Code Blocks
VitePress uses [Prism](https://prismjs.com/) to highlight language syntax in Markdown code blocks, using coloured text. Prism supports a wide variety of programming languages. All you need to do is append a valid language alias to the beginning backticks for the code block:
VitePress uses [Prism](https://prismjs.com) to highlight language syntax in Markdown code blocks, using coloured text. Prism supports a wide variety of programming languages. All you need to do is append a valid language alias to the beginning backticks for the code block:
**Input**

@ -57,7 +57,7 @@ export default {
</template>
```
The default export is the only contract for a custom theme. Inside your custom theme, it works just like a normal Vite + Vue 3 application. Do note the theme also needs to be [SSR-compatible](/guide/using-vue.html#browser-api-access-restrictions).
The default export is the only contract for a custom theme. Inside your custom theme, it works just like a normal Vite + Vue 3 application. Do note the theme also needs to be [SSR-compatible](./using-vue#browser-api-access-restrictions).
To distribute a theme, simply export the object in your package entry. To consume an external theme, import and re-export it from the custom theme entry:
@ -108,7 +108,7 @@ export default DefaultTheme
}
```
See [default theme CSS variables](https://github.com/vuejs/vitepress/blob/master/src/client/theme-default/styles/vars.css) that can be overridden.
See [default theme CSS variables](https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css) that can be overridden.
### Layout Slots
@ -135,9 +135,7 @@ const { Layout } = DefaultTheme
<template>
<Layout>
<template #sidebar-top>
My custom sidebar top content
</template>
<template #sidebar-top>My custom sidebar top content</template>
</Layout>
</template>
```

@ -40,7 +40,7 @@ Directives also work:
### Access to Site & Page Data
You can use the [`useData` helper](/guide/api.html#usedata) in a `<script>` block and expose the data to the page.
You can use the [`useData` helper](./api#usedata) in a `<script>` block and expose the data to the page.
**Input**
@ -107,9 +107,9 @@ This is a .md using a custom component
### Registering global components in the theme
If the components are going to be used across several pages in the docs, they can be registered globally in the theme (or as part of extending the default VitePress theme). Check out the [Theming Guide](./theming.md) for more information.
If the components are going to be used across several pages in the docs, they can be registered globally in the theme (or as part of extending the default VitePress theme). Check out the [Theming Guide](./theming) for more information.
In `.vitepress/theme/index.js`, the `enhanceApp` function receives the Vue `app` instance so you can [register components](https://v3.vuejs.org/guide/component-registration.html#component-registration) as you would do in a regular Vue application.
In `.vitepress/theme/index.js`, the `enhanceApp` function receives the Vue `app` instance so you can [register components](https://vuejs.org/guide/components/registration.html) as you would do in a regular Vue application.
```js
import DefaultTheme from 'vitepress/theme'
@ -200,7 +200,7 @@ export default {
## Built-In Components
VitePress provides Built-In Vue Components like `ClientOnly` and `OutboundLink`, check out the [Global Component Guide](./global-component.md) for more information.
VitePress provides Built-In Vue Components like `ClientOnly` and `OutboundLink`, check out the [Global Component Guide](./global-component) for more information.
**Also see:**
@ -208,7 +208,7 @@ VitePress provides Built-In Vue Components like `ClientOnly` and `OutboundLink`,
## Browser API Access Restrictions
Because VitePress applications are server-rendered in Node.js when generating static builds, any Vue usage must conform to the [universal code requirements](https://ssr.vuejs.org/en/universal.html). In short, make sure to only access Browser / DOM APIs in `beforeMount` or `mounted` hooks.
Because VitePress applications are server-rendered in Node.js when generating static builds, any Vue usage must conform to the [universal code requirements](https://vuejs.org/guide/scaling-up/ssr.html). In short, make sure to only access Browser / DOM APIs in `beforeMount` or `mounted` hooks.
If you are using or demoing components that are not SSR-friendly (for example, contain custom directives), you can wrap them inside the built-in `<ClientOnly>` component:
@ -258,4 +258,4 @@ export default {
**Also see:**
- [Vue.js > Dynamic Components](https://v3.vuejs.org/guide/component-dynamic-async.html)
- [Vue.js > Dynamic Components](https://vuejs.org/guide/essentials/component-basics.html#dynamic-components)

@ -8,7 +8,7 @@ sidebarDepth: 2
VitePress is currently in 0.x status. It is already suitable for out-of-the-box documentation use, but the config and theming API may still change between minor releases.
:::
VitePress is [VuePress](https://vuepress.vuejs.org/)' little brother, built on top of [Vite](https://github.com/vitejs/vite).
VitePress is [VuePress](https://vuepress.vuejs.org)' little brother, built on top of [Vite](https://github.com/vitejs/vite).
## Motivation

@ -54,25 +54,18 @@ const { lang } = useData()
// if the user has multiple locales, the search results should be filtered
// based on the language
const facetFilters: string[] = props.multilang
? ['lang:' + lang.value]
: []
const facetFilters: string[] = props.multilang ? ['lang:' + lang.value] : []
if (props.options.searchParameters?.facetFilters) {
facetFilters.push(...props.options.searchParameters.facetFilters)
}
watch(
lang,
(newLang, oldLang) => {
const index = facetFilters.findIndex(
(filter) => filter === 'lang:' + oldLang
)
if (index > -1) {
facetFilters.splice(index, 1, 'lang:' + newLang)
}
watch(lang, (newLang, oldLang) => {
const index = facetFilters.findIndex((filter) => filter === 'lang:' + oldLang)
if (index > -1) {
facetFilters.splice(index, 1, 'lang:' + newLang)
}
)
})
function initialize(userOptions: any) {
docsearch(

@ -33,7 +33,9 @@ function createContainer(klass: string, defaultTitle: string): ContainerArgs {
const info = token.info.trim().slice(klass.length).trim()
if (token.nesting === 1) {
if (klass === 'details') {
return `<details class="${klass} custom-block">${info ? `<summary>${info}</summary>` : ''}\n`
return `<details class="${klass} custom-block">${
info ? `<summary>${info}</summary>` : ''
}\n`
}
return `<div class="${klass} custom-block"><p class="custom-block-title">${
info || defaultTitle

@ -23,7 +23,7 @@ export interface ServeOptions {
export async function serve(options: ServeOptions = {}) {
const port = options.port !== undefined ? options.port : 5000
const site = await resolveConfig(options.root, 'serve', 'production')
const base = trimChar(site?.site?.base ?? "", "/")
const base = trimChar(site?.site?.base ?? '', '/')
const compress = compression()
const serve = sirv(site.outDir, {

Loading…
Cancel
Save