read-derived-variables.js 491 B

1234567891011121314151617181920212223
  1. module.exports = plugin;
  2. var utils = require('./utils');
  3. function plugin() {
  4. return (files, metalsmith, done) => {
  5. setImmediate(done);
  6. Object.keys(files).forEach(file_path => {
  7. const {file_name, lines} = utils.getLines(files, file_path);
  8. lines.forEach(line => {
  9. const variable = utils.parseLine(line);
  10. if (variable != false) {
  11. console.log('variable', variable);
  12. }
  13. });
  14. metalsmith.variables = variables;
  15. });
  16. };
  17. }