(Ghost 1.0)
Demo.
Cause of the theme adding a helper to show Post's TOC. You need to
- Add a line in the Ghost_Path/index.js
// Add this into Ghost_Path/index.js
require('./content/themes/anthem/helpers/anthem_toc')();- Add the new helper name into checklist. (Ghost will check whether there is any unknown helper.)
// Add the helper name in Ghost_Path/node_module/gscan/lib/spec.js which is looked like:
knowHelpers=['foreach',.......,'anthem_toc'];- Restart the server.
Tips: By the same method, you can add your own helper to themes.(I think it's stupid to prevent users to add their own helpers.)
-
Write the helper js file with the register method. (Ghost server's helpers are located in core/server/helpers/**.js, which are registered by core/server/helpers/index.js. Custom helper should register itself if you don't what to modified the server file.
-
Add the new helper into checklist which is located in Ghost_Path/node_module/gscan/lib/spec.js