Skip to content

Commit

Permalink
docs: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 30, 2024
1 parent 8c259eb commit 11c9993
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 68 deletions.
2 changes: 0 additions & 2 deletions docs/plugins/feed/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ If your site has a lot of articles, you may consider this option to reduce feed
## preservedElements

- Type: `(RegExp | string)[] | (tagName: string) => boolean`
- Default: `[]`

Custom element or component which should be preserved in feed.

Expand Down Expand Up @@ -192,7 +191,6 @@ Feed generation controller, see [Feed Getter](./getter.md).
## locales

- Type: `Record<string, BaseFeedOptions>`
- Required: No

You can use it to specific options for each locale.

Expand Down
74 changes: 36 additions & 38 deletions docs/zh/plugins/feed/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,56 @@

## hostname

- 类型: `string`
- 必填:
- 类型`string`
- 必填

部署网站的域名。

## atom

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

是否启用 Atom 格式输出。

## json

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

是否启用 JSON 格式输出。

## rss

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

是否启用 RSS 格式输出。

## image

- 类型: `string`
- 类型`string`

一个大的图片,用作 feed 展示。

## icon

- 类型: `string`
- 类型`string`

一个小的图标,显示在订阅列表中。

## count

- 类型: `number`
- 默认值: `100`
- 类型`number`
- 默认值`100`

设置 feed 的最大项目数量。在所有页面排序好后,插件会截取前 count 个项目。

如果你的站点文章很多,你应该考虑设置这个选项以减少 feed 文件大小。

## preservedElements

- 类型: `(RegExp | string)[] | (tagName: string) => boolean`
- 默认值: `[]`
- 类型:`(RegExp | string)[] | (tagName:string) => boolean`

应在 Feed 中保留的自定义元素或组件。

Expand All @@ -62,8 +61,8 @@

## filter

- 类型: `(page: Page)=> boolean`
- 默认值:
- 类型`(page: Page)=> boolean`
- 默认值

```ts
({ frontmatter, filePathRelative }: Page): boolean =>
Expand All @@ -79,9 +78,9 @@

## sorter

- 类型: `(pageA: Page, pageB: Page)=> number`
- 类型 `(pageA: Page, pageB: Page)=> number`

- 默认值:
- 默认值

```ts
// compareDate 来源于 vuepress-shared
Expand Down Expand Up @@ -114,8 +113,8 @@ Feed 项目的排序器。

## devServer

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

是否在开发服务器中启用

Expand All @@ -127,57 +126,57 @@ Feed 项目的排序器。

## devHostname

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

开发服务器使用的主机名

## atomOutputFilename

- 类型: `string`
- 默认值: `"atom.xml"`
- 类型`string`
- 默认值`"atom.xml"`

Atom 格式输出路径,相对于输出路径。

## atomXslTemplate

- 类型: `string`
- 默认值: `@vuepress/plugin-feed/templates/atom.xsl` 的内容
- 类型`string`
- 默认值`@vuepress/plugin-feed/templates/atom.xsl` 的内容

Atom xsl 模板文件没人陪美国

## atomXslFilename

- 类型: `string`
- 默认值: `"atom.xsl"`
- 类型`string`
- 默认值`"atom.xsl"`

Atom xsl 输出路径,相对于输出路径。

## jsonOutputFilename

- 类型: `string`
- 默认值: `"feed.json"`
- 类型`string`
- 默认值`"feed.json"`

JSON 格式输出路径,相对于输出路径。

## rssOutputFilename

- 类型: `string`
- 默认值: `"rss.xml"`
- 类型`string`
- 默认值`"rss.xml"`

RSS 格式输出路径,相对于输出路径。

## rssXslTemplate

- 类型: `string`
- 默认值: `@vuepress/plugin-feed/templates/rss.xsl` 的内容
- 类型`string`
- 默认值`@vuepress/plugin-feed/templates/rss.xsl` 的内容

RSS xsl 模板文件内容。

## rssXslFilename

- 类型: `string`
- 默认值: `"rss.xsl"`
- 类型`string`
- 默认值`"rss.xsl"`

RSS xsl 输出路径,相对于输出路径。

Expand All @@ -191,8 +190,7 @@ Feed 生成控制器,详见 [Feed 生成器](./getter.md)。

## locales

- 类型: `Record<string, BaseFeedOptions>`
- 必填: 否
- 类型:`Record<string, BaseFeedOptions>`

你可以将它用于每个语言环境的特定选项。

Expand Down
24 changes: 12 additions & 12 deletions docs/zh/plugins/feed/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,65 @@

### title

- 类型: `string`
- 类型`string`

由 VuePress 自动生成,默认为页面的 h1 内容

### description

- 类型: `string`
- 类型`string`

页面描述

### date

- 类型: `Date`
- 类型`Date`

页面的发布日期

### article

- 类型: `boolean`
- 类型`boolean`

该页面是否是文章

> 如果此项设置为 `false`,则该页不会包含在最终的 feed 中。
### copyright

- 类型: `string`
- 类型`string`

页面版权信息

### cover / image / banner

- 类型: `string`
- 类型`string`

页面的封面/分享图,需为完整链接或绝对链接。

## Frontmatter 选项

### feed.title

- 类型: `string`
- 类型`string`

Feed 项目的标题

### feed.description

- 类型: `string`
- 类型`string`

Feed 项目的描述

### feed.content

- 类型: `string`
- 类型`string`

Feed 项目的内容

### feed.author

- 类型: `FeedAuthor[] | FeedAuthor`
- 类型`FeedAuthor[] | FeedAuthor`

Feed 项目的作者

Expand Down Expand Up @@ -106,7 +106,7 @@ interface FeedAuthor {

### feed.contributor

- 类型: `FeedContributor[] | FeedContributor`
- 类型`FeedContributor[] | FeedContributor`

Feed 项目的贡献者

Expand Down Expand Up @@ -144,7 +144,7 @@ interface FeedContributor {

### feed.guid

- 类型: `string`
- 类型`string`

Feed 项目的标识符,用于标识 Feed 项目。

Expand Down
Loading

0 comments on commit 11c9993

Please sign in to comment.