@@ -7,6 +7,7 @@ const { log, logError, yellow } = require('@scullyio/scully');
77const configFile = readFileSync ( `${ process . cwd ( ) } /rss.config.json` , 'utf8' ) ;
88const config = JSON . parse ( configFile . toString ( ) ) ;
99const blogPostRouteSlug = config . blogPostRouteSlug || '/blog' ;
10+ const filename = config . filename || 'feed' ;
1011const feed = new Feed ( config ) ;
1112
1213config . categories . forEach ( ( cat ) => {
@@ -42,12 +43,12 @@ const rssPlugin = (routes) => {
4243 feed . addItem ( item ) ;
4344 } ) ;
4445 try {
45- writeFileSync ( join ( config . outDir || '' , 'feed .xml' ) , feed . rss2 ( ) ) ;
46- log ( `✅ Created ${ yellow ( config . outDir + '/feed .xml' ) } ` ) ;
47- writeFileSync ( join ( config . outDir || '' , 'feed .atom' ) , feed . atom1 ( ) ) ;
48- log ( `✅ Created ${ yellow ( config . outDir + '/feed .atom' ) } ` ) ;
49- writeFileSync ( join ( config . outDir || '' , 'feed .json' ) , feed . json1 ( ) ) ;
50- log ( `✅ Created ${ yellow ( config . outDir + '/feed .json' ) } ` ) ;
46+ writeFileSync ( join ( config . outDir || '' , ` ${ filename } .xml` ) , feed . rss2 ( ) ) ;
47+ log ( `✅ Created ${ yellow ( config . outDir + `/ ${ filename } .xml` ) } ` ) ;
48+ writeFileSync ( join ( config . outDir || '' , ` ${ filename } .atom` ) , feed . atom1 ( ) ) ;
49+ log ( `✅ Created ${ yellow ( config . outDir + `/ ${ filename } .atom` ) } ` ) ;
50+ writeFileSync ( join ( config . outDir || '' , ` ${ filename } .json` ) , feed . json1 ( ) ) ;
51+ log ( `✅ Created ${ yellow ( config . outDir + `/ ${ filename } .json` ) } ` ) ;
5152 } catch ( error ) {
5253 logError ( '❌ Failed to create RSS feed. Error:' , error ) ;
5354 throw error ;
0 commit comments