Feed Plugin Config

About 2 min

Intro enabled by default

vuepress-theme-hope provides feed generation support via the vuepress-plugin-feed2 plugin.

vuepress-theme-hope passes plugins.feed in theme options as plugin options to vuepress-plugin-feed2 plugin.

The vuepress-plugin-feed2 plugin can generate feed files in the following three formats for you:

  • Atom 1.0
  • JSON 1.1
  • RSS 2.0

Please enable the plugin by setting atom, json or rss to true in the plugin options according to the format you want to generate.

Tips

Atom and JSON are provided to provide more adaptations for Feed software.

If possible, use RSS as first choice.

Info

See the feed2 plugin documentationopen in new window for more details.

Plugin Options

atom

  • Type: boolean
  • Default: false

Whether to output Atom syntax files.

json

  • Type: boolean
  • Default: false

Whether output JSON syntax files.

rss

  • Type: boolean
  • Default: false

Whether to output RSS syntax files.

image

  • Type: string

A large image/icon of the feed, probably used as banner.

icon

  • Type: string

A small icon of the feed, probably used as favicon.

count

  • Type: number
  • Default: 1000

Set the maximum number of items in the feed. After all pages are sorted, the first count items will be intercepted.

If your site has a lot of articles, you may consider this option to reduce feed file size.

customElements

  • Type: string[]
  • Default: ["ExternalLinkIcon"]

Custom element or component which should be removed in feed.

filter

  • Type: (page: Page)=> boolean

  • Default:

    ({ frontmatter, filePathRelative }: Page): boolean =>
      !(
        frontmatter.home ||
        !filePathRelative ||
        frontmatter.article === false ||
        frontmatter.feed === false
      );
    

A custom filter funciton, used to filter feed items.

sort

  • Type: (pageA: Page, pageB: Page)=> number

A custom sort function, used to sort feed items.

Note

We strongly recommend you setting this option, otherwise the order of items in the feed stream is completely determined by the order of pages output by VuePress.

You can sort the pages in the site according to your needs.

channel

channel option is used to config Feed Channels.

For available options, please see Config → Channelopen in new window

atomOutputFilename

  • Type: string
  • Default: atom.xml

Atom syntax output filename, relative to output directory.

jsonOutputFilename

  • Type: string
  • Default: feed.json

JSON syntax output filename, relative to output directory.

rssOutputFilename

  • Type: string
  • Default: rss.xml

RSS syntax output filename, relative to output directory.

getter

Feed generation controller.

Tips

The plugin is providing a reasonable getter by default, if you want full control of feed generating, you can set this field.

For details, see Feed Getteropen in new window.

locales

  • Type: Record<string, BaseFeedOptions>
  • Required: No

You can use it to specific options for each locale.

Any options above are supported except hostname.

Loading...