Item Config

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

You can control the generation of each feed item individually by configuring the frontmatter of each page.

By default, all articles will be added to the feed stream. To remove a specific page from the feed, you can set feed.enable to false in frontmatter.

# FrontMatter options

The frontmatter options that affect the generation of feed items are as follows:

# title

  • Type: string

Automatically generated by VuePress, the default is the h1 content of the page

# description

  • Type: string

Description of the page

# article

  • Type: boolean

Whether this page is an article

If this option is set to false, the page will not be included in the final feed.

# copyrightText

  • Type: string

Copyright information of the page

# time

  • Type: Date

The publication date of the page

# image

  • Type: string (full or absolute link of the picture)

Cover/share image of the page

# Feed configuration in FrontMatter

# feed.enable

  • Type: boolean
  • Default: true

Whether this page is a feed item

# feed.title

  • Type: string

The title of the feed item

# feed.description

  • Type: string

Description of the feed item

# feed.content

  • Type: string

Content of the feed item

# feed.author

  • Type: FeedAuthor[]| FeedAuthor

The author of the feed item

`FeedAuthor` format
interface FeedAuthor {
  /** Author name */
  name: string;
  /** Author’s email */
  email?: string;
  /** Author’s 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

  • Type: FeedContributor[]| FeedContributor

Contributors to the feed item

`FeedContributor` format
interface FeedContributor {
  /** Name of ontributor */
  name: string;
  /** Contributor’s email */
  email?: string;
  /** Sharer website */
  url?: string;
  /**
   * Sharer’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.guid

  • Type: string

The identifier of the feed item, used to identify the feed item.

# Default generation logic

  • title

    • Type: string
    • Meaning: The title of the feed item
    • Value:
      • frontmatter.feed.title
      • If the above is not provided, fall back to frontmatter.title
  • link

    • Type: string
    • Meaning: Link to feed item
    • Value:
      • Permalink of the page
      • If the above does not exist, fall back to the page link
  • description

    • Type: string
    • Meaning: the description of the feed item
    • Value:
      • frontmatter.feed.description
      • If the above is not provided, fall back to frontmatter.description
      • If the above is not provided, fall back to $page.excerpt
  • author

    • Type: FeedAuthor[]| FeedAuthor

    • Meaning: the author of the feed item

    • Value:

      • frontmatter.feed.author

      • If the above is not provided, fall back to frontmatter.author

        (string type, only name is generated)

      • If the above is not provided, fall back to themeConfig.author

        (string type, only name is generated)

  • contributor

    • Type: FeedContributor[]| FeedContributor

    • Meaning: Contributor to the Feed project

    • Value:

      • frontmatter.feed.contributor

      • If the above is not provided, fall back to frontmatter.author

        (string type, only name is generated)

      • If the above is not provided, fall back to themeConfig.author

        (string type, only name is generated)

  • category

    • Type: FeedCategory[] | FeedCategory

    • Meaning: Category of feed items

    • Value:

      • frontmatter.feed.category

      • If the above is not provided, fall back to frontmatter.category

        (string type, only name is generated)

  • pubDate

    • Type: Date
    • Meaning: The release date of the feed item
    • Value: frontmatter.time
  • lastUpdated

    • Type: Date
    • Meaning: The update date of the feed item
    • Value: Generated by Git
  • content

    • Type: string
    • Meaning: the content of the feed item
    • Value: HTML content of the page
  • image

    • Type: string
    • Meaning: The cover of the feed item
    • Value:
      • frontmatter.image
      • If the above is not provided, fall back to the first non-relative image link in the page content
  • enclosure

    • Type: string
    • Meaning: media of the feed item
    • Value: Generated by the image option above
  • copyright

    • Type: string
    • Meaning: Copyright information of the feed item
    • Value:
      • frontmatter.copyrightText
      • If the above is not provided, try to generate the copyright information of Copyright by author