assemble / grunt-assemble-permalinks

Permalinks middleware for Assemble, the static site generator for Grunt.js and Yeoman. This plugin enables powerful and configurable URI replacement patterns, presets, uses Moment.js for parsing dates, and much more.
MIT License
43 stars 11 forks source link

add check to prevent plugin from looping over every page when each pages... #10

Closed jonschlinkert closed 11 years ago

jonschlinkert commented 11 years ago

... is built

doowb commented 11 years ago

@jonschlinkert okay, I see what you did. This was my first thought and I think it works for this plugin.

The other option is to do something like...

if(!_.isUndefined(permalinks)) {
  if (permalinks.finished && permalinks.finished === true) {
    callback();
    return;
  }

  permalinks.finished = true;
  // run the pages loop here
}