Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Install handlebars-layout

  • #3210
    Avatar photo[anonymous]

    The topic title says all: how can I install this npm module and compile with it?

    #3221
    Avatar photo[anonymous]

    Hi,

    I do not understand a reason of your question and what do you want to achieve – could you elaborate?

    #3232
    Avatar photo[anonymous]

    Hi! Thanks for answering. I thought it was clear, my fault.

    I wish I could use helpers like this while making my theme:

    `{{#extend [partial] [context] [key=value …]}}`

    Or, also: `{{#embed}}`, `{{#block [name]}}`  and the others included in handlebars-layout npm package.

    I’m used to write themes in jinja2 and this kind of helpers would be very useful to me.

    Do you know how I should install this package in Publii in order to enable those helpers?

    Thanks again

    #3262
    Avatar photo[anonymous]

    Sorry but this kind of change cannot be made externally – it needs a changes in the core Publii files. And to be honest I do not see a necessity to add such syntax.

    Handlebars supports similar features:

    https://handlebarsjs.com/guide/partials.html#partial-parameters

    https://handlebarsjs.com/guide/partials.html#partial-contexts

    #3278
    Avatar photo[anonymous]

    Hmm, I see. Thanks! I’ll try doing my theme without these functions.

    In order to install this package, I tried to build Publii from source with npm but it failed every time. But that’s another problem, thanks again for answering.