helpers / handlebars-helper-lorem

{{lorem}} handlebars helper, for generating lorem lorem placeholder text.
http://assemble.io/helpers/
MIT License
5 stars 0 forks source link

Blank output in assemble 0.4.42 #2

Open andymantell opened 9 years ago

andymantell commented 9 years ago

After the refactor in #1, I am now getting no output from the {{lorem}} tag. I have deleted and rebuilt node_modules for good measure, and I'm pretty sure I'm including the helper correctly in my gruntfile:

assemble: {
  options: {
    flatten: false,
    layout: 'default.hbs',
    layoutdir: 'src/core/templates/layouts',
    partials: ['src/core/templates/partials/**/*.hbs'],
    helpers: [
      'handlebars-helper-lorem',
      'helpers/**/*.js'
    ],
    plugins: ['assemble-permalink']
  },

I'm aware that assemble 0.6 is on the cards though and I don't want to divert your attention too much from that. This is a very non critical bug from my point of view as I can just paste lorem in from elsewhere! If it's fixable when you get a moment that would be amazing, but obviously this is fairly unimportant in the scheme of things.

If there's any more information I can provide that would be helpful in debugging it let me know.

jonschlinkert commented 9 years ago

Thanks for letting me know. It might be something fairly trivial.

@doowb was this part necessary? (sorry for being lazy, but I wanted to avoid installing grunt and assemble in this helper, to avoid bloating it)

doowb commented 9 years ago

Oh... for it to work in assemble 0.4.0 the register function needs to register the helper with Handlebars itself.

jonschlinkert commented 9 years ago

bah, that's right. forgot about that, I'll get it fixed. thx @doowb.

doowb commented 9 years ago

I have an idea on how to fix this so the new system doesn't try to use the register function as an actual helper.

doowb commented 9 years ago

Oh... nvm... what you did should work as long as you take in Handlebars and do registerHelper... I was going to make the register method by using Object.defineProperty so it's not enumerable, but that's probably overkill.

jonschlinkert commented 9 years ago

@andymantell I updated the helper. I might be able to do a bit more to it early next week if this doesn't work for you. Although if you're open to it, it might be better to hold out for assemble v0.6.0

andymantell commented 9 years ago

Yeah, not to worry, I can wait until 0.6.0. Thanks very much for your help, much appreciated.