mixu / ghost-render

Render static blog sites from Markdown using Ghost themes
224 stars 21 forks source link

Missing helpers needed by Casper #6

Open creationix opened 7 years ago

creationix commented 7 years ago

I tried this project out following the README and got hit with:

/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/lib/theme.js:102
      if (err) { throw err; }
                 ^
Error: Missing helper: 'is'
    at Exception (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/exception.js:13:41)
    at Object.<anonymous> (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/base.js:66:13)
    at Object.eval (eval at createFunctionContext (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:171:23), <anonymous>:4:68)
    at ret (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/runtime.js:137:30)
    at ret (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:422:21)
    at Object.invokePartial (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/runtime.js:181:12)
    at Object.invokePartialWrapper [as invokePartial] (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/runtime.js:46:39)
    at Object.eval (eval at createFunctionContext (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:171:23), <anonymous>:7:17)
    at prog (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/runtime.js:168:15)
    at Object.<anonymous> (/home/tim/nvm/versions/node/v8.1.2/lib/node_modules/ghost-render/node_modules/handlebars/dist/cjs/handlebars/base.js:187:14)

My guess is the newest Casper theme uses some helpers that weren't there when you last tested this.

I tried to monkey-patch the code to add in the handlebars-helpers module, but I can't seem to get it hooked up.

mixu commented 7 years ago

hmm looks like Ghost is also using Handlebars 4 (via express-hbs) so upgrading hbs seems like a decent first step

https://themes.ghost.org/docs/changelog seems to list the recent changes - I last tested this using 0.5.0 soooo there are a couple of new additions

in theory at least you should be able to monkey patch here https://github.com/mixu/ghost-render/blob/master/lib/ghost/helpers/helpers.js by copying helpers from https://github.com/TryGhost/Ghost/tree/master/core/server/helpers but you might need to adjust it a bit.

I wish Ghost made this a bit easier by splitting out the theme rendering from the rest of product, I'm sure they aren't doing that for competitive reasons tho :(

creationix commented 7 years ago

Thanks for the tips. I'm busy for the next while and so won't be able to dive in.

Do you intend to update to latest ghost themes, or has your time also been eaten by other pursuits?