add css to support rss view better
- You are using node hexo
- Your website(Wiki/Blog) are using hexo plugin - hexo-generator-feed
- You want to make your rss looking better
add css to the rss'xml
Watch my Demo
Ok, everybody.Let's begin.
cd ./your website dir/node-modules/hexo-generator-feed/lib/
vim generator.js
2. change code undiffent.Also you can directly clone, but it's not recommend...
- css/rss.css in my gayhub is necessary!!
- add this code:
var rssCssSrc = pathFn.join(__dirname, '../css/rss.css');
var rssCssTmpl = nunjucks.compile(fs.readFileSync(rssCssSrc, 'utf8'), env);
- change this code on the end:
var rssCss = rssCssTmpl.render();
return [
{
path: feedConfig.path,
data: xml
},
{
path: feedConfig.path.substr(0,feedConfig.path.length - 8) + "css/rss.css",
data: rssCss
}
];