Skip to content

Commit 61176e5

Browse files
committed
chore: use log and yellow from scully
1 parent 1717d31 commit 61176e5

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

plugins/rss/src/rss.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ const configFile = readFileSync(`${process.cwd()}/rss.config.json`, 'utf8');
88
const config = JSON.parse(configFile.toString());
99
const blogPostRouteSlug = config.blogPostRouteSlug || '/blog';
1010
const feed = new Feed(config);
11+
12+
const { log, yellow } = require('@scullyio/scully');
13+
1114
config.categories.forEach((cat) => {
1215
feed.addCategory(cat);
1316
});
1417

1518
const rssPlugin = (routes) => {
16-
console.log('Started @notiz/scully-plugin-rss');
19+
log('Started @notiz/scully-plugin-rss');
20+
1721
const blogPosts = routes.filter(
1822
(r) =>
1923
r && r.data && r.data.published && r.route.includes(blogPostRouteSlug)
@@ -29,8 +33,8 @@ const rssPlugin = (routes) => {
2933
});
3034
}
3135

32-
console.log(
33-
`Generating RSS Feed for ${blogPosts.length} blog ${
36+
log(
37+
`Generating RSS Feed for ${yellow(blogPosts.length)} published blog ${
3438
blogPosts.length === 1 ? 'post' : 'posts'
3539
}`
3640
);
@@ -40,13 +44,13 @@ const rssPlugin = (routes) => {
4044
feed.addItem(item);
4145
});
4246
writeFileSync(join(config.outDir || '', 'feed.xml'), feed.rss2());
43-
console.log(`✅ Created ${join(config.outDir || '', 'feed.xml')}`);
47+
log(`✅ Created ${yellow(config.outDir + '/feed.xml')}`);
4448
writeFileSync(join(config.outDir || '', 'feed.atom'), feed.atom1());
45-
console.log(`✅ Created ${join(config.outDir || '', 'feed.atom')}`);
49+
log(`✅ Created ${yellow(config.outDir + '/feed.atom')}`);
4650
writeFileSync(join(config.outDir || '', 'feed.json'), feed.json1());
47-
console.log(`✅ Created ${join(config.outDir || '', 'feed.json')}`);
51+
log(`✅ Created ${yellow(config.outDir + '/feed.atom')}`);
4852

49-
console.log('Finished @notiz/scully-plugin-rss');
53+
log('Finished @notiz/scully-plugin-rss');
5054
};
5155

5256
const createFeedItemFromRoute = (route) => {

0 commit comments

Comments
 (0)