@alterjs/saber-plugin-feed
v0.12.2
Published
Generate Atom, RSS2, or JSON feed for your Saber app
Downloads
7
Readme
@alterjs/saber-plugin-feed
Generate feed in Atom 1.0 or RSS 2.0 or JSON format.
Install
yarn add @alterjs/saber-plugin-feed
Usage
In your saber-config.yml
:
plugins:
- resolve: '@alterjs/saber-plugin-feed'
options:
# Generate atom.xml
atomFeed: true
# Generate rss2.xml
rss2Feed: true
# Generate feed.json
jsonFeed: true
Get Feed Links in Component
This plugin will also inject feed links as Vue computed property:
// Recommended feed, atom > rss2 > json
this.$feed
// { permalink: string, type: 'atom' | 'rss2' | 'json' }
this.$allFeeds
// { rss2?: string, json?: string, atom?: string }
Configure Feed Author
In your saber-config.yml
:
siteConfig:
author: Your Name # Optional
url: https://example.com # Required
email: [email protected] # Optional
Options
atomFeed
- Type:
string
boolean
- Default:
undefined
The output path of the Atom feed, when true
it outputs to atom.xml
.
rss2Feed
- Type:
string
boolean
- Default:
undefined
The output path of the RSS2 feed, when true
it outputs to rss2.xml
.
jsonFeed
- Type:
string
boolean
- Default:
undefined
The output path of the JSON feed, when true
it outputs to feed.json
.
limit
- Type:
number
- Default:
30
The maximum amount of posts to include in the feed.
copyright
- Type:
string
- Default:
All rights reserved
The copyright info in the feed.
License
MIT.