Is it possible to register user assistants in Ghost?

I use Ghost as an npm module after this guide .

I would like to add some custom helpers that can be used inside my themes. Is there a way to do this without changing the code inside the Ghost module?

This is my current code:

const ghost = require('ghost'); const path = require('path'); const hbs = require('express-hbs'); const config = path.join(__dirname, 'config.js'); const coreHelpers = {}; coreHelpers.sd_nls = require('./sd_nls'); // Register a handlebars helper for themes function registerThemeHelper(name, fn) { hbs.registerHelper(name, fn); } registerThemeHelper('sd_nls', coreHelpers.sd_nls); ghost({ config: config }) .then(ghostServer => ghostServer.start()); 

I think one of the possible problems is that my hbs is a new instance of handlebars and not the one used by Ghost, so when Ghost is running it does not contain any helpers that I registered.

+7
javascript ghost
source share

No one has answered this question yet.

See related questions:

2687
Is it possible to apply CSS to half a character?
4
Error: Missing helper in Handlebars.js
one
Registering Express and HBS Custom Assistants
0
Why can't I use the if statement inside my express handbars template?
0
express-handlebars & webpack - cannot export partial files and helpers in a multi-page application
0
Using helper templates helper in hapijs
0
Handlebars Custom Assistant Shows Missing Assistant After Deployment
0
Access html post from Ghost Custom Handlebars Helper blog
0
i18n-node-2, Express and Handlebers Assistant
0
passing parameters of the Handlebars Helper function from the client to the server

All Articles