Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #58 from ft-interactive/rss-feed
Browse files Browse the repository at this point in the history
Create RSS feed in dist
  • Loading branch information
Sumeet Adur committed Dec 23, 2015
2 parents 7648174 + 77c3c0b commit aa643c0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,15 @@ gulp.task('build', done => {

runSequence(
// preparatory
['clean', /* 'scsslint', 'eslint', */ 'download-data', 'create-rss-feed'],
['clean', /* 'scsslint', 'eslint', */ 'download-data'],
// preprocessing (client/templates => .tmp)
['scripts', 'styles', 'templates'],
// optimisation (+ copying over misc files) (.tmp/client => dist)
['minify-js', 'minify-css', 'compress-images', 'copy-misc-files'],
// finalise the HTML in dist (by inlining small scripts/stylesheets then minifying the HTML)
['finalise-html'],
// create RSS feed in dist
['create-rss-feed'],
done);
});

Expand Down Expand Up @@ -391,7 +393,7 @@ gulp.task('templates', () => {
fs.writeFileSync(`.tmp/thanks.html`, thanksPageHtml);
});

gulp.task('create-rss-feed', ['download-data'], () => {
gulp.task('create-rss-feed', () => {

const rssTitle = 'Guffipedia';
const rssLink = 'http://ft.com/guff';
Expand Down Expand Up @@ -419,11 +421,11 @@ gulp.task('create-rss-feed', ['download-data'], () => {
}
rssString += '</channel></rss>';

fs.writeFileSync('rss.xml', rssString);
fs.writeFileSync('dist/rss.xml', rssString);

gulp.src('rss.xml')
gulp.src('dist/rss.xml')
.pipe(prettyData({type: 'prettify'}))
.pipe(gulp.dest('.'));
.pipe(gulp.dest('dist'));
});

// helpers
Expand Down

0 comments on commit aa643c0

Please sign in to comment.