Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    ankursanghi
    @ankursanghi
    anyone know why i get Error: Missing partial with my layout partials
    @shannonmoeller highly appreciate if you could say where the helper is looking. i tried placing my partial in views/partials and also by leaving it in views/layouts
    ankursanghi
    @ankursanghi
    the issue is that i am using express-handlebars and not sure at what point it loads the partials... arghh!
    Shannon Moeller
    @shannonmoeller
    @ankursanghi I have an express test case that might be helpful: https://github.com/shannonmoeller/handlebars-layouts/blob/master/test/express.js
    ankursanghi
    @ankursanghi
    Thank you Shannon!
    Gevorg Harutyunyan
    @modularcoder

    @shannonmoeller Thanks for awesome plugins!

    We're using gulp-hb and handlebars-layouts in our build stack. We're working on a open source admin theme.
    http://modularcode.github.io/modularity-free-admin-dashboard-theme-html/

    And this is our task for processing pages.
    https://github.com/ModularCode/modularity-free-admin-dashboard-theme-html/blob/master/tasks/app-pages.js

    Shannon Moeller
    @shannonmoeller
    @madextreme Awesome! Glad you've found it to be useful.
    andfelzapata
    @andfelzapata
    Hi @shannonmoeller, awesome thing you did with handlebars-layouts. I've read the docs, but I'm a bit confused on how to include this in my backboneJS code. Can you give me a hint ?
    Shannon Moeller
    @shannonmoeller
    @andfelzapata Thanks! Super sorry for the late reply. Just saw this. Are you currently using handlebars on your project?
    andfelzapata
    @andfelzapata
    @shannonmoeller No worries, I am using handlebars.
    Shannon Moeller
    @shannonmoeller
    @andfelzapata What build system (if any) are you using?
    andfelzapata
    @andfelzapata
    gulp
    huytiki
    @huytiki
    Hi guys, i has a problem when using gulp-hb load json data from file. Anybody can help me?
    Here my gulp function: gulp.task('tpl', function () {
    var hbStream = hb()
    .partials('./templates/assets/partials/.{hbs,js}')
    .partials('./templates/assets/partials/components/
    .{hbs,js}')
    .partials('./templates/assets/partials/layouts/.{hbs,js}')
    .data('./templates/assets/data/
    .{js,json}')
    .data({
    icon: "icon.png",
    });;
    return gulp
    .src('./templates/{,/*}.html')
    .pipe(hbStream)
    .pipe(gulp.dest('./build'));
    });
    it doesn't load data :(
    Jan Rembold
    @janrembold
    Hi Shannon, maybe we switch to this room. Github issues isn't the right place for a chat :D
    dheerajmeetuni
    @dheerajmeetuni
    Hi @shannonmoeller , i am getting error when i use handlebars-layout module with consolidate.js , Error: Missing partial: 'layout'
    at Object.extend (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars-layouts\index.js:120:11)
    at Object.eval [as main] (eval at createFunctionContext (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:254:23), <anonymous>:5:92)
    at main (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\runtime.js:175:32)
    at ret (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\runtime.js:178:12)
    at ret (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:526:21)
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:735:16
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:144:5
    at Promise._execute (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\bluebird\js\release\debuggability.js:303:9)
    at Promise._resolveFromExecutor (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\bluebird\js\release\promise.js:79:10)
    at promisify (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:137:10)
    at Function.exports.handlebars.render (C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:725:10)
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:165:27
    at C:\Users\Dheeraj Marvel\Desktop\punchtantra\node_modules\consolidate\lib\consolidate.js:99:5
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

    registraion code i use -
    var handlebarsLayouts = require('handlebars-layouts'),
    handlebars = require('handlebars');
    handlebarsLayouts.register(handlebars);

    // handlebars partials
    var partials = path.join(__dirname, 'views/partials');
    var recursive = require('recursive-readdir');
    recursive(partials, function (err, files) {
    files.forEach(function (filename) {
    file = filename.slice(filename.lastIndexOf('/')+1);
    var matches = /^([^.]+).hbs$/.exec(file);
    if (!matches) {return;}
    var name = matches[1];
    var template = filename;
    handlebars.registerPartial(name, read(template));
    });
    });

    ------------------- set up hbs engine ----
    app.engine('hbs', cons.handlebars);
    app.set('views', path.join(__dirname, 'views'));
    app.set('view engine', 'hbs');
    i am unable tp understand where i am doing wrong ,is this issue with your library or consolidate.js ?
    George
    @goshatravin
    hi