Skip to content

Commit

Permalink
docs: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 30, 2024
1 parent 5af18ea commit bd72368
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 97 deletions.
49 changes: 31 additions & 18 deletions docs/plugins/sitemap/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,44 @@
## hostname

- Type: `string`

- Required: Yes

The domain name where the current site is deployed, the plugin needs this option to work.
- Details:

The domain name where the current site is deployed, the plugin needs this option to work.

## extraUrls

- Type: `string[]`
- Required: No

Extra links to be included.
- Details:

If you have some links not including in VuePress Router (normally in public directory or generated by other tools directly), you may need this option.
Extra link to be included.

E.g.: `['/about.html', '/api/']`
If you have some links not including in VuePress Router (normally in public directory or generated by other tools directly), you may need this option.

- Example: `['/about.html', '/api/']`

## excludeUrls

- Type: `string[]`

- Default: `['/404.html']`

Urls excluding from sitemap, starting with absolute path.
- Details:

By default, all the urls generated by VuePress (excluding 404 page) will be added into sitemap.
Urls excluding from sitemap, starting with absolute path.

By default, all the urls generated by VuePress (excluding 404 page) will be added into sitemap.

## devServer

- Type: `boolean`
- Default: `false`
- Details:

Whether enabled in devServer.
Whether enabled in devServer.

::: tip

Expand All @@ -44,51 +52,56 @@ For performance reasons, we do not provide hot reload. Reboot your devServer to

- Type: `string`
- Default: `"http://localhost:${port}"`
- Details:

Hostname to use in devServer
Hostname to use in devServer

## sitemapFilename

- Type: `string`
- Default value: `"sitemap.xml"`
- Details:

The output filename, relative to output directory.
The output filename, relative to output directory.

## sitemapXSLFilename

- Type: `string`
- Default value: `"sitemap.xsl"`
- Details:

Output xsl filename, relative to dest folder.
Output xsl filename, relative to dest folder.

## sitemapXSLTemplate

- Type: `string`
- Default value: `"@vuepress/plugin-sitemap/templates/sitemap.xsl"`
- Details:

XSL content used as template.
XSL content used as template.

## changefreq

- Type: `"always" | "hourly" | "daily" | "weekly" |"monthly" | "yearly" | "never"`
- Default value: `"daily"`
- Details:


Page default update frequency, will be overridden by [sitemap.changefreq](./frontmatter.md#sitemap-changefreq) in Frontmatter.

Page default update frequency, will be overridden by [sitemap.changefreq](./frontmatter.md#sitemap-changefreq) in Frontmatter.

## priority

- Type: `number`

- Default: `0.5`

Page priority, from `0` to `1`.
- Details:

Page priority, from `0` to `1`.

## modifyTimeGetter

- Type: `(page: Page, app: App) => string`

- Required: `false`
- Details:

Last modify time getter. By default, the plugin will use the timestamp generated by git plugin.
Last modify time getter. By default, the plugin will use the timestamp generated by git plugin.
12 changes: 7 additions & 5 deletions docs/plugins/sitemap/frontmatter.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@

# Frontmatter Config
# Frontmatter

## sitemap

- Type: `SitemapFrontmatterOptions | false`
- Required: No
- Details:

`false` means exclude the page from sitemap.
`false` means exclude the page from sitemap.

### sitemap.changefreq

- Type: `"always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never"`
- Default: `"daily"`
- Details:

Page default update frequency. This will override [changefreq](./config.md#changefreq) in Plugin Options.
Page default update frequency. This will override [changefreq](./config.md#changefreq) in Plugin Options.

### sitemap.priority

- Type: `number`
- Default: `0.5`
- Details:

Page priority, range from `0` to `1`.
Page priority, range from `0` to `1`.
2 changes: 1 addition & 1 deletion docs/themes/default/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ You must add an empty line between the starting tag of `<CodeGroupItem>` and the

All content must be valid Markdown first, and then a Vue SFC.

Learn more: [Cookbook > Markdown and Vue SFC](../../advanced/cookbook/markdown-and-vue-sfc.md)
Learn more: [Cookbook > Markdown and Vue SFC](https://v2.vuepress.vuejs.org/advanced/cookbook/markdown-and-vue-sfc.html)

Alternatively, you can use the [custom containers](./markdown.md#custom-containers).
:::
10 changes: 5 additions & 5 deletions docs/themes/default/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

All the options inside the [Locale Config](#locale-config) section can be used in locales.

This option will only take effect in default theme, so don't confuse with `locales` in [Site Config](../config.md#locales).
This option will only take effect in default theme, so don't confuse with `locales` in [Site Config](./config.md#locales).

- Also see:
- [Guide > I18n](../../guide/i18n.md)
- [Guide > I18n](https://v2.vuepress.vuejs.org/guide/i18n.html)

## Locale Config

Expand Down Expand Up @@ -184,7 +184,7 @@ export default {
```

- Also see:
- [Guide > Assets > Public Files](../../guide/assets.md#public-files)
- [Guide > Assets > Public Files](https://v2.vuepress.vuejs.org/guide/assets.html#public-files)

### logoDark

Expand Down Expand Up @@ -244,7 +244,7 @@ export default {

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.
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

Expand Down Expand Up @@ -414,7 +414,7 @@ export default {
- Set to `2` to include `<h2>` and `<h3>` headers.
- ...

The max value depends on which levels of headers you have extracted via [markdown.headers.level](../config.md#markdown-headers).
The max value depends on which levels of headers you have extracted via [markdown.headers.level](https://v2.vuepress.vuejs.org/reference/config.html#markdown-headers).

The default value of `markdown.headers.level` is `[2, 3]`, so the default max value of `sidebarDepth` is `2`.

Expand Down
2 changes: 1 addition & 1 deletion docs/themes/default/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Then the default `Layout` layout has been overridden by your own local layout, w

The layout slots are useful, but sometimes you might find it's not flexible enough. Default theme also provides the ability to replace a single component.

Default theme has registered [alias](../plugin-api.md#alias) for every [non-global components](https://github.com/vuepress/ecosystem/tree/main/themes/theme-default/src/client/components) with a `@theme` prefix. For example, the alias of `HomeFooter.vue` is `@theme/HomeFooter.vue`.
Default theme has registered [alias](https://v2.vuepress.vuejs.org/plugin-api.html#alias) for every [non-global components](https://github.com/vuepress/ecosystem/tree/main/themes/theme-default/src/client/components) with a `@theme` prefix. For example, the alias of `HomeFooter.vue` is `@theme/HomeFooter.vue`.

Then, if you want to replace the `HomeFooter.vue` component, just override the alias in your config file `.vuepress/config.ts`:

Expand Down
8 changes: 4 additions & 4 deletions docs/themes/default/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Frontmatter in this section will take effect in all types of pages.

- Details:

Provided by [@vuepress/plugin-external-link-icon](../plugin/external-link-icon.md#externallinkicon).
Provided by [@vuepress/plugin-external-link-icon](../../plugins/external-link-icon.md#externallinkicon).

- Also see:
- [Default Theme > Config Reference > themePlugins.externalLinkIcon](./config.md#themeplugins-externallinkicon)
Expand Down Expand Up @@ -99,7 +99,7 @@ heroImage: https://vuejs.org/images/logo.png
```

- Also see:
- [Guide > Assets > Public Files](../../guide/assets.md#public-files)
- [Guide > Assets > Public Files](https://v2.vuepress.vuejs.org/guide/assets.html#public-files)

### heroImageDark

Expand Down Expand Up @@ -147,7 +147,7 @@ heroImage: https://vuejs.org/images/logo.png

Specify the the hero text.

This will fallback to the site [title](../config.md#title).
This will fallback to the site [title](https://v2.vuepress.vuejs.org/reference/config.html#title).

Set to `null` to disable hero text.

Expand All @@ -159,7 +159,7 @@ heroImage: https://vuejs.org/images/logo.png

Specify the the tagline.

This will fallback to the site [description](../config.md#description).
This will fallback to the site [description](https://v2.vuepress.vuejs.org/reference/config.html#description).

Set to `null` to disable tagline.

Expand Down
84 changes: 44 additions & 40 deletions docs/zh/plugins/sitemap/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,40 @@

## hostname

- 类型: `string`
- 类型`string`
- 必填: 是
- 详情:

当前网站部署到的域名,插件需要此选项才能工作。
当前网站部署到的域名,插件需要此选项才能工作。

## extraUrls

- 类型: `string[]`
- 必填: 否
- 类型`string[]`
- 详情:

需要额外包含的网址。
需要额外包含的网址。

如果你有一些不包含在 VuePress 路由中的链接 (如: 存放在 public 文件夹下的页面或其他插件或工具直接生成的页面),你可能需要设置此项。
如果你有一些不包含在 VuePress 路由中的链接 (如: 存放在 public 文件夹下的页面或其他插件或工具直接生成的页面),你可能需要设置此项。

例如: `['/about.html', '/api/']`
- 示例:`['/about.html', '/api/']`

## excludeUrls

- 类型: `string[]`
- 默认值: `['/404.html']`
- 类型:`string[]`
- 默认值:`['/404.html']`
- 详情:

不需要收录的页面路径,请以绝对路径开头。
不需要收录的页面路径,请以绝对路径开头。

默认情况下 VuePress 自动生成的所有路径 (除 404 页) 都会被添加进 Sitemap。
默认情况下 VuePress 自动生成的所有路径 (除 404 页) 都会被添加进 Sitemap。

## devServer

- 类型: `boolean`
- 默认值: `false`
- 类型:`boolean`
- 默认值:`false`
- 详情:

是否在开发服务器中启用
是否在开发服务器中启用

::: tip

Expand All @@ -42,54 +45,55 @@

## devHostname

- 类型: `string`
- 默认值: `"http://localhost:${port}"`
- 类型:`string`
- 默认值:`"http://localhost:${port}"`
- 详情:

开发服务器使用的主机名
开发服务器使用的主机名

## sitemapFilename

- 类型: `string`
- 默认值: `"sitemap.xml"`
- 类型:`string`
- 默认值:`"sitemap.xml"`
- 详情:

输出的文件名,相对于输出目录。
输出的文件名,相对于输出目录。

## sitemapXSLFilename

- 类型: `string`
- 默认值: `"sitemap.xsl"`
- 类型:`string`
- 默认值:`"sitemap.xsl"`
- 详情:

输出的 xsl 文件名,相对于输出目录。
输出的 xsl 文件名,相对于输出目录。

## sitemapXSLTemplate

- 类型: `string`
- 默认值: `"@vuepress-plugin/sitemap/templates/sitemap.xsl"`
- 类型:`string`
- 默认值:`"@vuepress-plugin/sitemap/templates/sitemap.xsl"`
- 详情:

用作模板的 XSL 文件内容
用作模板的 XSL 文件内容

## changefreq

- 类型: `"always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never"`
- 默认值: `"daily"`
- 类型:`"always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never"`
- 默认值:`"daily"`
- 详情:

<!-- markdownlint-disable MD051 -->

页面默认更新频率,会被 Frontmatter 中的 [changefreq](#sitemap-changefreq) 选项覆盖。

<!-- markdownlint-enable MD051 -->
页面默认更新频率,会被 Frontmatter 中的 [changefreq](./frontmatter.md#sitemap-changefreq) 选项覆盖。

## priority

- 类型: `number`

- 默认值: `0.5`
- 类型`number`
- 默认值:`0.5`
- 详情:

页面优先级,范围 `0``1`
页面优先级,范围 `0``1`

## modifyTimeGetter

- 类型: `(page: Page, app: App) => string`
- 必填: 否
- 类型`(page: Page, app: App) => string`
- 详情:

最后修改事件的获得器,需要返回一个 ISO 字符形式的时间,默认会自动通过 Git 插件生成。
最后修改事件的获得器,需要返回一个 ISO 字符形式的时间,默认会自动通过 Git 插件生成。
Loading

0 comments on commit bd72368

Please sign in to comment.