@tomlingdev/scully-plugin-rss
v1.2.0
Published
scully plugin generate a RSS Feed XML
Downloads
2
Readme
scully-plugin-rss
This repo is forked from the amazing scully-plugins by notiz.dev.
scully-plugin-rss
is a routeDiscoveryDone
plugin for Scully. A RSS Feed is created from your content using feed and showdown.
The rss feed is available at:
- your-domain.dev/feed.json
- your-domain.dev/feed.atom
- your-domain.dev/feed.xml
To change the filename of the feed, use the filename
attribute in your rss.config.json file, as seen below. The default value is feed, but you can change it to whatever you'd like.
📦 Installation
Install the RSS Feed plugin using the command
npm install @tomling/scully-plugin-rss --save-dev
Note:
routeDiscoveryDone
plugin requires@scullyio/scully
in version ^1.0.5 or above to correctly parse date values from markdown front matter.
Usage
Import the plugin in the Scully config file scully.app-name.config.ts
:
import { ScullyConfig } from '@scullyio/scully';
import '@tomling/scully-plugin-rss';
export const config: ScullyConfig = {
projectRoot: './src/app',
routes: {
...
},
};
It will run on only routes that include /blog
unless specified otherwise in the rss.config.json
file. The order of the posts will be oldest first unless the newestPostsFirst
option is set in the config.
Create a rss.config.json
in your root with the following properties:
{
"title": "Your Title",
"description": "Page description",
"id": "https://your-domain.com",
"link": "https://your-domain.com",
"language": "en",
"image": "https://your-domain.com/featured.png",
"favicon": "https://you-domain.com/favicon.png",
"copyright": "2020 your-domain.com",
"generator": "Page description",
"filename": "feed",
"feedLinks": {
"atom": "https://your-domain.com/feed.atom",
"json": "https://your-domain.com/feed.json",
"xml": "https://your-domain.com/feed.xml"
},
"outDir": "./dist/static",
"categories": ["Categories", "of", "your", "choice"],
"blogPostRouteSlug": "/blog",
"newestPostsFirst": true
}
Each RSS Feed item attributes are currently assigned by the following scully route attributes.
| RSS Feed Item | Scully Route |
| ------------- | ----------------------------- |
| title
| title
|
| id
| slug
|
| link
| Config Link + slug
|
| description
| description
|
| content
| articleHTML
|
| author
| authors
|
| contributor
| authors
|
| date
| updatedAt
| publishedAt
|
Your content should have the following front matter in your scully content:
---
title: Martial Arts Training
description: Best Martial Arts Training
publishedAt: 2020-03-25T10:12:00.000Z
updatedAt: 2020-03-25T10:12:00.000Z
published: true
tags:
- training
- rss
authors:
- Bruce Lee
---