Guide

Mr.Hope ... 2021-1-24 About 2 min

# Usage

@mr-hope/vuepress-plugin-feed plugin will automatically generate feed in the following three formats for you

  • Atom 1.0
  • JSON 1.1
  • RSS 2.0

Tips

Atom and JSON are provided to improve more feed software adaptation.

Please use RSS by default.

Considering that rare people stick to feed now, this plugin provides a minimal configuration to adjust the automatic generation of detailed feed files. Also it allows you to freely define the output content of the feed.

To generate the link address correctly, you need to provide hostname (deployment domain name) in the plugin options or themeConfig. All other options are optional.

# Channel Settings

You can customize information of feed channel by setting the channel option.

We recommend you to set the following options:

  • Convert the date when the feed was created to ISOString and write it to channel.pubDate
  • Set the content update cycle (unit: minute) in channel.ttl
  • Set your copyright information through channel.copyright
  • Set channel author via channel.author, or set themeConfig.author as the author name.

Default channel settings

  • The title and description of the channel is the name and description of the site by default

  • The link of the channel, the last update time will be automatically generated by the plugin.

  • The plugin will try to generate copyright information by reading the copyright information in the footer.

For detailed options and their values, please see Configuration → Channel Settings

# Project Settings

# Default generation logic

By default, all articles will be added to the feed stream.

Articles

All pages whose frontmatter.article is not false and are not the homepage will be regarded as articles.

@mr-hope/vuepress-plugin-feed will read the following options from frontmatter:

  • description: the description of the article

  • author: the name of the author of the article

  • copyrightText: the copyright information of the article

-time: the publication time of the article

-image: the cover of the article

@mr-hope/vuepress-plugin-feed also use the following items:

  • page.excerpt: any content before <!-- more --> , used as the alternative description of the article
  • The rendered page content: used to describe the content of the feed item

# Customize

You can control the generation of feed items for specific articles by configuring the feed options in frontmatter.

To remove a specific page from the feed, you can set feed.enable to false in the frontmatter of the page.

You can also add content directly to the feed plugin via frontmatter.feed. The supported options are as follows:

  • feed.title: Override default article title for feed items

  • feed.description: Override the default article description for the feed item

  • feed.author: Set multiple authors and detailed author information, the format is FeedAuthor[] | FeedAuthor.

    Read from frontmatter.author by default.

    FeedAuthor Format
    interface FeedAuthor {
      /** Author name */
      name: string;
      /** Author email */
      email?: string;
      /** Author website */
      url?: string;
      /**
       * Author’s avatar address
       *
       * Square, preferably not less than 128×128, transparent background
       */
      avator?: string;
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
  • feed.contributor: Set multiple contributors and detailed contributor information, the format is FeedContributor[] | FeedContributor

    FeedContributor option is exactly the same as FeedAuthor. This option is the same as feed.author by default.

  • feed.category: Set multiple detailed categories information, the format is FeedCategory[] | FeedCategory

    FeedCategory Format
    interface FeedCategory {
      /** Category name */
      name: string;
      /**
       * Category domain
       *
       * @description rss format only
       */
      domain?: string;
      /**
       * The categorization scheme via a URI
       *
       * @description atom format only
       */
      scheme?: string;
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
  • feed.guid: The feed item identifier, permanent link of the page or page link by default

For detailed options and their default values, please see Configuration → Item

# Output configuration

You can use the output in the configuration options to decide which feed file formats to output and their location.

For detailed options and their default values, please see Configuration → Output