1.0.0 • Published 7 years ago
gulp-feed v1.0.0
gulp-rss
Generate RSS file with gulp
This plugin generates an RSS file from files with metadata, such as front matter
extracted from gulp-front-matter
.
Requires Node version ≥ 0.12
Usage
var frontMatter = require('gulp-front-matter');
var rss = require('gulp-rss')
gulp.task('rss', function() {
gulp.files('./feeds/*.md') // Read input files
.pipe(frontMatter()) // Extract YAML Front-Matter
.pipe(rss( // Generate RSS data
// Configuration
{
render: "atom-1.0", // Feed type (atom-1.0 or rss-2.0) default is atom-1.0
data: "frontMatter", // name of property containing the data, typically extracted front-matter
filename: "feed.xml", //the name of the file for the xml feed
// Feed configuration
feedOptions: {
title: 'My blog', // Feed title (mandatory)
description: 'My very own blog', // Feed description (optional)
link: 'http://my.bl.og', // Feed link (optional)
author: { name: 'Nicolas Chambrier' }, // Blog's author (optional)
content: true // add content to the feed (optional)
// etc…
},
properties: {
// Property names mapping
title: 'title', // post's title (means plugin will read `file.frontMatter.title`, mandatory)
link: 'permalink', // post's URL (mandatory)
description: 'description', // post's description (optional)
author: 'author', // post's author (optional)
date: 'date', // post's publication date (mandatory, default = now)
image: 'image' // post's thumbnail (optional)
}
}
))
.pipe(gulp.dest('./public/')) // Write output
});
See https://github.com/jpmonette/feed for the whole RSS configuration. This is the underlying module.
Plugin can get file.data
from gulp-data
on default.
1.0.0
7 years ago