rss.js 519 B

1234567891011121314151617
  1. /**
  2. * Module dependencies.
  3. */
  4. var pug = require('../')
  5. , path = __dirname + '/rss.pug'
  6. , str = require('fs').readFileSync(path, 'utf8')
  7. , fn = pug.compile(str, { filename: path, pretty: true });
  8. var items = [];
  9. items.push({ title: 'Example', description: 'Something', link: 'http://google.com' });
  10. items.push({ title: 'LearnBoost', description: 'Cool', link: 'http://learnboost.com' });
  11. items.push({ title: 'Express', description: 'Cool', link: 'http://expressjs.com' });
  12. console.log(fn({ items: items }));