Open yumyo opened 10 years ago
Which version of assemble are you using? There might be something missing from the handlebars-helpers repo.
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.
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']
thanks for the info! (it will be a year in July, but who's counting? ;)
Whoops... I take it back! I don't know what date I was looking at. LOL
lol no worries. the info you posted is still really useful!
@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!
@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
Trying to "assemble" my blog pages I get the following error
Missing helper: 'eachItems'