docs: adjust the use of configs -> config

pull/1978/head
Evan You 2 years ago
parent e8e87215ac
commit 191ac86a85

@ -58,7 +58,7 @@ export default defineConfig({
function nav() {
return [
{ text: 'Guide', link: '/guide/what-is-vitepress', activeMatch: '/guide/' },
{ text: 'Configs', link: '/config/introduction', activeMatch: '/config/' },
{ text: 'Config Reference', link: '/config/introduction', activeMatch: '/config/' },
{
text: pkg.version,
items: [
@ -139,12 +139,12 @@ function sidebarGuide() {
function sidebarConfig() {
return [
{
text: 'Config',
text: 'Config Reference',
items: [
{ text: 'Introduction', link: '/config/introduction' },
{ text: 'App Configs', link: '/config/app-configs' },
{ text: 'Theme Configs', link: '/config/theme-configs' },
{ text: 'Frontmatter Configs', link: '/config/frontmatter-configs' }
{ text: 'App Config', link: '/config/app-config' },
{ text: 'Default Theme Config', link: '/config/theme-config' },
{ text: 'Frontmatter Config', link: '/config/frontmatter-config' }
]
}
]

@ -1,10 +1,10 @@
# App Configs
# App Config
App configs are where you can define the global settings of the site. App configs define fundamental settings that are not only limited to the theme configs such as configuration for "base directory", or the "title" of the site.
App config is where you can define the global settings of the site. App config options define settings that apply to every VitePress site, regardless of what theme it is using. For example, the base directory or the title of the site.
```ts
export default {
// These are app level configs.
// app level config options
lang: 'en-US',
title: 'VitePress',
description: 'Vite & Vue powered static site generator.',
@ -115,7 +115,7 @@ export default {
- Type: `boolean`
- Default: `false`
Use git commit to get the timestamp. This option enables the default theme to display the page's last updated time. You can customize the text via [`themeConfig.lastUpdatedText`](theme-configs#lastupdatedtext) option.
Use git commit to get the timestamp. This option enables the default theme to display the page's last updated time. You can customize the text via [`themeConfig.lastUpdatedText`](theme-config#lastupdatedtext) option.
```ts
export default {

@ -1,6 +1,6 @@
# Frontmatter Configs
# Frontmatter Config
Frontmatter enables page based configuration. On every markdown, you're free to add Any settings to override any global app or theme configs. Also, there are configs which you can only define in Frontmatter.
Frontmatter enables page based configuration. In every markdown file, you can use frontmatter config to override app-level or theme config options. Also, there are config options which you can only define in frontmatter.
```yaml
---
@ -9,7 +9,7 @@ editLink: true
---
```
You may access frontmatter by `$frontmatter` helper inside any markdown file.
You can access frontmatter by `$frontmatter` helper inside any markdown file.
```md
{{ $frontmatter.title }}
@ -19,7 +19,7 @@ You may access frontmatter by `$frontmatter` helper inside any markdown file.
- Type: `string`
Title for the page. It's same as [config.title](../config/app-configs#title), and it overrides the app config.
Title for the page. It's same as [config.title](../config/app-config#title), and it overrides the app config.
```yaml
---
@ -31,7 +31,7 @@ title: VitePress
- Type: `string | boolean`
The suffix for the title. It's same as [config.titleTemplate](../config/app-configs#titletemplate), and it overrides the app config.
The suffix for the title. It's same as [config.titleTemplate](../config/app-config#titletemplate), and it overrides the app config.
```yaml
---
@ -44,7 +44,7 @@ titleTemplate: Vite & Vue powered static site generator
- Type: `string`
Description for the page. It's same as [config.description](../config/app-configs#description), and it overrides the app config.
Description for the page. It's same as [config.description](../config/app-config#description), and it overrides the app config.
```yaml
---
@ -189,4 +189,4 @@ aside: false
- Type: `number | [number, number] | 'deep' | false`
- Default: `2`
The levels of header in the outline to display for the page. It's same as [config.themeConfig.outline](../config/theme-configs#outline), and it overrides the theme config.
The levels of header in the outline to display for the page. It's same as [config.themeConfig.outline](../config/theme-config#outline), and it overrides the theme config.

@ -15,11 +15,11 @@ Place your configuration file at `.vitepress/config.js`. This is where all ViteP
You can also use any of `.ts`, `.cjs`, `.mjs`, `.cts`, `.mts` as the config file extension.
:::
VitePress comes with 2 types of configs. One is the [App Configs](./app-configs) which configures the site's fundamental features such as setting title of the site, or customize how markdown parser works. Second is the [Theme Config](./theme-configs) which configures the theme of the site, for example, adding a sidebar, or add features such as "Edit this page on GitHub" link.
VitePress comes with 2 types of configuration. One is the [App Config](./app-config) which configures the site's fundamental features such as setting title of the site, or customize how markdown parser works. Second is the [Theme Config](./theme-config) which configures the theme of the site, for example, adding a sidebar, or add features such as "Edit this page on GitHub" link.
There's also another configuration you may do in [Frontmatter](./frontmatter-configs). Frontmatter configs can override global configs defined on App Configs or Theme Configs for that specific page. However, there're several options that are only available at frontmatter as well.
There's also another configuration you may do in [Frontmatter](./frontmatter-config). Frontmatter config can override global config defined in App Config or Theme Config for that specific page. However, there're several options that are only available at frontmatter as well.
Please refer to the corresponding configs page to learn more.
Please refer to the corresponding config page to learn more.
## Config Intellisense

@ -1,6 +1,6 @@
# Theme Configs
# Default Theme Config
Theme configs let you customize your theme. You can define theme configs by adding `themeConfig` key to the config file.
Theme config lets you customize your theme. You can define theme config via the `themeConfig` option in the config file:
```ts
export default {
@ -17,7 +17,7 @@ export default {
}
```
Here it describes the settings for the VitePress default theme. If you're using a custom theme created by others, these settings may not have any effect, or might behave differently.
**The options documented on this page only apply to the default theme.** Different themes expect different theme config. When using a custom theme, the theme config object will be passed to the theme so the theme can define conditional behavior based on it.
## i18nRouting

@ -66,7 +66,7 @@ interface Router {
- **Type**: `(path: string) => string`
Appends the configured [`base`](../config/app-configs#base) to a given URL path. Also see [Base URL](./asset-handling#base-url).
Appends the configured [`base`](../config/app-config#base) to a given URL path. Also see [Base URL](./asset-handling#base-url).
## `<Content />`

@ -24,4 +24,4 @@ In the above example, the site will have the title of `VitePress`, and `Just pla
Learn everything about VitePress features at [Theme: Introduction](./theme-introduction) to find how to configure specific features within this config file.
You may also find all configuration references at [Configs](../config/introduction).
You may also find all configuration references at [Config Reference](../config/introduction).

@ -17,7 +17,7 @@ The following guides are based on some shared assumptions:
::: tip
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`.
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-config#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/`.
@ -82,8 +82,8 @@ Don't enable options like _Auto Minify_ for HTML code. It will remove comments f
deploy:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

@ -9,7 +9,7 @@ editLink: true
---
```
Between the triple-dashed lines, you can set [predefined variables](../config/frontmatter-configs), or even create custom ones of your own. These variables can be used via the special <code>$frontmatter</code> variable.
Between the triple-dashed lines, you can set [predefined variables](../config/frontmatter-config), or even create custom ones of your own. These variables can be used via the special <code>$frontmatter</code> variable.
Here's an example of how you could use it in your Markdown file:

@ -281,7 +281,7 @@ export default {
A [list of valid languages](https://github.com/shikijs/shiki/blob/main/docs/languages.md) is available on Shiki's repository.
You may also customize syntax highlight theme in app config. Please see [`markdown` options](../config/app-configs#markdown) for more details.
You may also customize syntax highlight theme in app config. Please see [`markdown` options](../config/app-config#markdown) for more details.
## Line Highlighting in Code Blocks
@ -493,7 +493,7 @@ export default {
}
```
Please see [`markdown` options](../config/app-configs#markdown) for more details.
Please see [`markdown` options](../config/app-config#markdown) for more details.
You can add `:line-numbers` / `:no-line-numbers` mark in your fenced code blocks to override the value set in config.
@ -748,4 +748,4 @@ module.exports = {
}
```
See full list of configurable properties in [Configs: App Configs](../config/app-configs#markdown).
See full list of configurable properties in [Config Reference: App Config](../config/app-config#markdown).

@ -20,4 +20,4 @@ If you're coming from VitePress 0.x version, there're several breaking changes d
## Frontmatter Config
- `home: true` option has changed to `layout: home`. Also, many Homepage related settings have been modified to provide additional features. See [Home Page guide](./theme-home-page) for details.
- `footer` option is moved to [`themeConfig.footer`](../config/theme-configs#footer).
- `footer` option is moved to [`themeConfig.footer`](../config/theme-config#footer).

@ -49,7 +49,7 @@ docs/index.md -> /
docs/getting-started.md -> /getting-started.html
```
You may also customize the root directory in config file via [`srcDir`](/config/app-configs#srcdir) option too. Running `vitepress dev` with the following setting acts same as running `vitepress dev docs` command.
You may also customize the root directory in config file via [`srcDir`](/config/app-config#srcdir) option too. Running `vitepress dev` with the following setting acts same as running `vitepress dev docs` command.
```ts
export default {
@ -88,7 +88,7 @@ By default, VitePress generates the final static page files by adding `.html` ex
└─ index.md
```
However, you may also generate a clean URL by setting up [`cleanUrls`](/config/app-configs#cleanurls) option.
However, you may also generate a clean URL by setting up [`cleanUrls`](/config/app-config#cleanurls) option.
```ts
export default {
@ -120,7 +120,7 @@ packages/pkg-a/src/pkg-a-code.md -> /pkg-a/pkg-a-code.md
packages/pkg-b/src/pkg-b-code.md -> /pkg-b/pkg-b-code.md
```
You may configure the mapping via [`rewrites`](/config/app-configs#rewrites) option like this.
You may configure the mapping via [`rewrites`](/config/app-config#rewrites) option like this.
```ts
export default {

@ -4,7 +4,7 @@ The Nav is the navigation bar displayed on top of the page. It contains the site
## Site Title and Logo
By default, nav shows the title of the site referencing [`config.title`](../config/app-configs#title) value. If you would like to change what's displayed on nav, you may define custom text in `themeConfig.siteTitle` option.
By default, nav shows the title of the site referencing [`config.title`](../config/app-config#title) value. If you would like to change what's displayed on nav, you may define custom text in `themeConfig.siteTitle` option.
```js
export default {
@ -35,7 +35,7 @@ export default {
}
```
You can also pass an object as logo if you want to add `alt` attribute or customize it based on dark/light mode. Refer [`themeConfig.logo`](../config/theme-configs#logo) for details.
You can also pass an object as logo if you want to add `alt` attribute or customize it based on dark/light mode. Refer [`themeConfig.logo`](../config/theme-config#logo) for details.
## Navigation Links
@ -46,7 +46,7 @@ export default {
themeConfig: {
nav: [
{ text: 'Guide', link: '/guide' },
{ text: 'Configs', link: '/configs' },
{ text: 'Config', link: '/config' },
{ text: 'Changelog', link: 'https://github.com/...' }
]
}
@ -140,4 +140,4 @@ export default {
## Social Links
Refer [`socialLinks`](../config/theme-configs#sociallinks).
Refer [`socialLinks`](../config/theme-config#sociallinks).

@ -1,6 +1,6 @@
# Sidebar
The sidebar is the main navigation block for your documentation. You can configure the sidebar menu in [`themeConfig.sidebar`](/config/theme-configs#sidebar).
The sidebar is the main navigation block for your documentation. You can configure the sidebar menu in [`themeConfig.sidebar`](/config/theme-config#sidebar).
```js
export default {

@ -207,7 +207,7 @@ interface TeamMember {
// Social links. e.g. GitHub, Twitter, etc. You may pass in
// the Social Links object here.
// See: https://vitepress.vuejs.org/config/theme-configs.html#sociallinks
// See: https://vitepress.vuejs.org/config/theme-config.html#sociallinks
links?: SocialLink[]
// URL for the sponsor page for the member.

@ -263,7 +263,7 @@ export default {
## Using Teleports
Vitepress currently has SSG support for teleports to body only. For other targets, you can wrap them inside the built-in `<ClientOnly>` component or inject the teleport markup into the correct location in your final page HTML through [`postRender` hook](../config/app-configs#postrender).
Vitepress currently has SSG support for teleports to body only. For other targets, you can wrap them inside the built-in `<ClientOnly>` component or inject the teleport markup into the correct location in your final page HTML through [`postRender` hook](../config/app-config#postrender).
<ModalDemo />

@ -99,7 +99,7 @@ export function resolveSiteDataByRoute(
}
/**
* Create the page title string based on configs.
* Create the page title string based on config.
*/
export function createTitle(siteData: SiteData, pageData: PageData): string {
const title = pageData.title || siteData.title

Loading…
Cancel
Save