mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
7069cc1221
refs: https://github.com/TryGhost/Team/issues/759 - wired up a matchHelper feature flag & used the labsEnabledHelper tool to gate the helper - added a first version of the match helper, which is intended to replace the has helper - this is an experimental helper and may or may not make it to GA - match is a simple comparison helper, right now it does a very basic equals or not equals comparison - much more functionality is needed to reach parity with has
53 lines
2.6 KiB
JavaScript
53 lines
2.6 KiB
JavaScript
const register = require('./register');
|
|
const coreHelpers = require('../../../helpers');
|
|
const registerThemeHelper = register.registerThemeHelper;
|
|
const registerAsyncThemeHelper = register.registerAsyncThemeHelper;
|
|
|
|
const registerAllCoreHelpers = function registerAllCoreHelpers() {
|
|
// Register theme helpers
|
|
registerThemeHelper('asset', coreHelpers.asset);
|
|
registerThemeHelper('author', coreHelpers.author);
|
|
registerThemeHelper('authors', coreHelpers.authors);
|
|
registerThemeHelper('body_class', coreHelpers.body_class);
|
|
registerThemeHelper('cancel_link', coreHelpers.cancel_link);
|
|
registerThemeHelper('concat', coreHelpers.concat);
|
|
registerThemeHelper('content', coreHelpers.content);
|
|
registerThemeHelper('date', coreHelpers.date);
|
|
registerThemeHelper('encode', coreHelpers.encode);
|
|
registerThemeHelper('excerpt', coreHelpers.excerpt);
|
|
registerThemeHelper('foreach', coreHelpers.foreach);
|
|
registerThemeHelper('ghost_foot', coreHelpers.ghost_foot);
|
|
registerThemeHelper('has', coreHelpers.has);
|
|
registerThemeHelper('is', coreHelpers.is);
|
|
registerThemeHelper('img_url', coreHelpers.img_url);
|
|
registerThemeHelper('lang', coreHelpers.lang);
|
|
registerThemeHelper('link', coreHelpers.link);
|
|
registerThemeHelper('link_class', coreHelpers.link_class);
|
|
registerThemeHelper('match', coreHelpers.match);
|
|
registerThemeHelper('meta_description', coreHelpers.meta_description);
|
|
registerThemeHelper('meta_title', coreHelpers.meta_title);
|
|
registerThemeHelper('navigation', coreHelpers.navigation);
|
|
registerThemeHelper('page_url', coreHelpers.page_url);
|
|
registerThemeHelper('pagination', coreHelpers.pagination);
|
|
registerThemeHelper('plural', coreHelpers.plural);
|
|
registerThemeHelper('post_class', coreHelpers.post_class);
|
|
registerThemeHelper('price', coreHelpers.price);
|
|
registerThemeHelper('raw', coreHelpers.raw);
|
|
registerThemeHelper('reading_time', coreHelpers.reading_time);
|
|
registerThemeHelper('t', coreHelpers.t);
|
|
registerThemeHelper('tags', coreHelpers.tags);
|
|
registerThemeHelper('title', coreHelpers.title);
|
|
registerThemeHelper('twitter_url', coreHelpers.twitter_url);
|
|
registerThemeHelper('facebook_url', coreHelpers.facebook_url);
|
|
registerThemeHelper('url', coreHelpers.url);
|
|
|
|
// Async theme helpers
|
|
registerAsyncThemeHelper('ghost_head', coreHelpers.ghost_head);
|
|
registerAsyncThemeHelper('next_post', coreHelpers.prev_post);
|
|
registerAsyncThemeHelper('prev_post', coreHelpers.prev_post);
|
|
registerAsyncThemeHelper('get', coreHelpers.get);
|
|
};
|
|
|
|
module.exports = coreHelpers;
|
|
module.exports.loadCoreHelpers = registerAllCoreHelpers;
|