Skip to content

Commit

Permalink
docs: update default-theme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 31, 2024
1 parent 033ffe9 commit aa55e22
Show file tree
Hide file tree
Showing 8 changed files with 653 additions and 624 deletions.
2 changes: 2 additions & 0 deletions docs/.vuepress/configs/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export const sidebarEn: SidebarConfig = {
children: [
'/themes/default/',
'/themes/default/config',
'/themes/default/plugin',
'/themes/default/locale',
'/themes/default/frontmatter',
'/themes/default/components',
'/themes/default/markdown',
Expand Down
3 changes: 3 additions & 0 deletions docs/.vuepress/configs/sidebar/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const sidebarZh: SidebarConfig = {
children: [
'/zh/plugins/feed/guide',
'/zh/plugins/feed/config',
'/zh/themes/default/plugin',
'/zh/plugins/feed/frontmatter',
'/zh/plugins/feed/channel',
'/zh/plugins/feed/getter',
Expand Down Expand Up @@ -79,6 +80,8 @@ export const sidebarZh: SidebarConfig = {
children: [
'/zh/themes/default/',
'/zh/themes/default/config',
'/zh/themes/default/plugin',
'/zh/themes/default/locale',
'/zh/themes/default/frontmatter',
'/zh/themes/default/components',
'/zh/themes/default/markdown',
Expand Down
313 changes: 1 addition & 312 deletions docs/themes/default/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Config of this section can be used as normal config, and can also be used in the

- Also see:
- [Default Theme > Config > colorMode](#colormode)
- [Default Theme > Config > toggleColorMode](#togglecolormode)
- [Default Theme > Locale Config > toggleColorMode](./locale.md#togglecolormode)

### home

Expand Down Expand Up @@ -224,73 +224,6 @@ export default {
}
```

### repoLabel

- Type: `string`

- Details:

Specify the repository label of your project.

This will be used as the text of the _repository link_, which will be displayed as the last item of the navbar.

If you don't set this option explicitly, it will be automatically inferred from the [repo](#repo) option.

### selectLanguageText

- Type: `string`

- Details:

Specify the text of the _select language menu_.

The _select language menu_ will appear next to the repository button in the navbar when you set multiple [locales](./config.md#locales) in your site config.

### selectLanguageAriaLabel

- Type: `string`

- Details:

Specify the `aria-label` attribute of the _select language menu_.

This is mainly for a11y purpose.

### selectLanguageName

- Type: `string`

- Details:

Specify the name of the language of a locale.

This option will **only take effect inside** the [locales](#locales) of your theme config. It will be used as the language name of the locale, which will be displayed in the _select language menu_.

- Example:

```ts
export default {
locales: {
'/': {
lang: 'en-US',
},
'/zh/': {
lang: 'zh-CN',
},
},
theme: defaultTheme({
locales: {
'/': {
selectLanguageName: 'English',
},
'/zh/': {
selectLanguageName: '简体中文',
},
},
}),
}
```

### sidebar

- Type: `false | 'auto' | SidebarConfigArray | SidebarConfigObject`
Expand Down Expand Up @@ -432,16 +365,6 @@ export default {

You can override this global option via [editLink](./frontmatter.md#editlink) frontmatter in your pages.

### editLinkText

- Type: `string`

- Default: `'Edit this page'`

- Details:

Specify the text of the _edit this page_ link.

### editLinkPattern

- Type: `string`
Expand Down Expand Up @@ -525,16 +448,6 @@ The generated link will look like `'https://gitlab.com/owner/name/-/edit/master/

You can override this global option via [lastUpdated](./frontmatter.md#lastupdated) frontmatter in your pages. Notice that if you have already set this option to `false`, this feature will be disabled totally and could not be enabled in locales nor page frontmatter.

### lastUpdatedText

- Type: `string`

- Default: `'Last Updated'`

- Details:

Specify the text of the _last updated timestamp_ label.

### contributors

- Type: `boolean`
Expand All @@ -546,227 +459,3 @@ The generated link will look like `'https://gitlab.com/owner/name/-/edit/master/
Enable the _contributors list_ or not.

You can override this global option via [contributors](./frontmatter.md#contributors) frontmatter in your pages. Notice that if you have already set this option to `false`, this feature will be disabled totally and could not be enabled in locales nor page frontmatter.

### contributorsText

- Type: `string`

- Default: `'Contributors'`

- Details:

Specify the text of the _contributors list_ label.

### tip

- Type: `string`

- Default: `'TIP'`

- Details:

Specify the default title of the tip [custom containers](./markdown.md#custom-containers).

### warning

- Type: `string`

- Default: `'WARNING'`

- Details:

Specify the default title of the warning [custom containers](./markdown.md#custom-containers).

### danger

- Type: `string`

- Default: `'DANGER'`

- Details:

Specify the default title of the danger [custom containers](./markdown.md#custom-containers).

### notFound

- Type: `string[]`

- Default: `['Not Found']`

- Details:

Specify the messages of the 404 page.

The message will be randomly picked from the array when users enter the 404 page.

### backToHome

- Type: `string`

- Default: `'Back to home'`

- Details:

Specify the text of the _back to home_ link in the 404 page.

### openInNewWindow

- Type: `string`

- Default: `'open in new window'`

- Details:

Specify the `sr-only` text of the [ExternalLinkIcon](../../plugins/external-link-icon.md#externallinkicon).

This is mainly for a11y purpose.

- Also see:
- [Default Theme > Config Reference > themePlugins.externalLinkIcon](#themeplugins-externallinkicon)

### toggleColorMode

- Type: `string`

- Default: `'toggle color mode'`

- Details:

Title text for the color mode toggle button.

This is mainly for a11y purpose.

- Also see:
- [Default Theme > Config > colorModeSwitch](#colormodeswitch)

### toggleSidebar

- Type: `string`

- Default: `'toggle sidebar'`

- Details:

Title text for sidebar toggle button.

This is mainly for a11y purpose.

## Plugins Config

### themePlugins

- Details:

Configure the plugins that used by default theme.

Default theme is using some plugins by default. You can disable a plugin if you really do not want to use it. Make sure you understand what the plugin is for before disabling it.

### themePlugins.activeHeaderLinks

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-active-header-links](../../plugins/active-header-links.md) or not.

### themePlugins.backToTop

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-back-to-top](../../plugins/back-to-top.md) or not.

### themePlugins.container

- Type: `Record<ContainerType, boolean>`

- Details:

Enable custom containers that powered by [@vuepress/plugin-container](../../plugins/container.md) or not.

`ContainerType` type is:

- `tip`
- `warning`
- `danger`
- `details`
- `codeGroup`
- `codeGroupItem`

- Also see:
- [Default Theme > Markdown > Custom Containers](./markdown.md#custom-containers)

### themePlugins.externalLinkIcon

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-external-link-icon](../../plugins/external-link-icon.md) or not.

### themePlugins.copyCode

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-copy-code](../../plugins/copy-code.md) or not.

### themePlugins.git

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-git](../../plugins/git.md) or not.

### themePlugins.mediumZoom

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-medium-zoom](../../plugins/medium-zoom.md) or not.

### themePlugins.nprogress

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-nprogress](../../plugins/nprogress.md) or not.

### themePlugins.seo

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-seo](../../plugins/seo/README.md) or not.

### themePlugins.sitemap

- Type: `boolean`

- Default: `true`

- Details:

Enable [@vuepress/plugin-sitemap](../../plugins/sitemap/README.md) or not.
Loading

0 comments on commit aa55e22

Please sign in to comment.