helpers / handlebars-helper-paginate

{{paginate}} handlebars helper. Made for Assemble, the static site generator for Node.js, Grunt.js and Yeoman.
MIT License
6 stars 0 forks source link

Missing helper: 'eachItems' #2

Open yumyo opened 10 years ago

yumyo commented 10 years ago

Trying to "assemble" my blog pages I get the following error Missing helper: 'eachItems'

doowb commented 10 years ago

Which version of assemble are you using? There might be something missing from the handlebars-helpers repo.

yumyo commented 10 years ago

assemble: 0.4.41 I've tried an npm update but everything seems up to date.

This is my sample Gruntfile.js:

assemble: {
      options: {
        flatten: true,
        helpers: ['src/helpers/*.js','handlebars-helper-paginate'],
        assets: 'dest/assets',
        layoutdir: 'src/templates/layouts',
        partials: ['src/templates/partials/*.hbs', './*.md'],
        plugins : [ 'assemble-collection-context' ],
        context : { dest: '.tmp/' }
      },
      posts: {
        options: {
          ext: '.html',
          engine: 'handlebars'
        },
        files: {
          'dest/': ['src/content/blog/*.md']
        }
      },
      general: {
        options: {
          layout: 'home.hbs',
          data: '.tmp/*.json'
        },
        files: {
          'dest/': ['src/templates/pages/*.hbs']
        }
      }

I'm calling {{paginate pagination}} in a layout .hbs file.

RickHocutt commented 9 years ago

Last post was over a year ago but in case anyone is looking... Adding "handlebars-helper-eachitems" to the helpers array fixed this issue for me: helpers: ['handlebars-helper-paginate', 'handlebars-helper-eachitems', 'foo/*.js']

jonschlinkert commented 9 years ago

thanks for the info! (it will be a year in July, but who's counting? ;)

RickHocutt commented 9 years ago

Whoops... I take it back! I don't know what date I was looking at. LOL

jonschlinkert commented 9 years ago

lol no worries. the info you posted is still really useful!

jgibba commented 9 years ago

@RickHocutt @jonschlinkert Did you get this pagination helper to work correctly? In your layouts.hbs do you have some kind of loop that shows x posts? Then how does that pagination know to show the next item from that loop? I added the following to my gruntfile form your comments above:

helpers: ['handlebars-helper-paginate', 'handlebars-helper-eachitems', 'foo/*.js']

What would './*.md' be in this case? Is it the directory where all the posts are contained and would want to change.

Any help greatly appreciated on getting this to work thanks!

jonschlinkert commented 9 years ago

@jgibba we're working on releasing the next version of assemble, the goal is to make it much easier to do this kind of stuff. we're also going to have more active support channels opening up soon, so we can have real-time discussions when questions like this pop up. In the meantime stackoverflow is probably a better place to ask