mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-04 04:10:33 +03:00
294187c41f
no issue - removed code that now lives in the external Koenig monorepo
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
const common = require('../common');
|
|
const config = require('../../config');
|
|
|
|
let cardFactory, cards;
|
|
|
|
module.exports = {
|
|
get cards() {
|
|
if (cards) {
|
|
return cards;
|
|
}
|
|
|
|
const CardFactory = require('@tryghost/kg-card-factory');
|
|
const defaultCards = require('@tryghost/kg-default-cards');
|
|
|
|
cardFactory = new CardFactory({
|
|
siteUrl: config.get('url')
|
|
});
|
|
|
|
cards = defaultCards.map((card) => {
|
|
return cardFactory.createCard(card);
|
|
});
|
|
|
|
return cards;
|
|
},
|
|
|
|
get atoms() {
|
|
return require('@tryghost/kg-default-atoms');
|
|
},
|
|
|
|
get renderers() {
|
|
return require('./renderers');
|
|
},
|
|
|
|
get htmlToMobiledocConverter() {
|
|
try {
|
|
return require('@tryghost/html-to-mobiledoc').toMobiledoc;
|
|
} catch (err) {
|
|
return () => {
|
|
throw new common.errors.InternalServerError({
|
|
message: 'Unable to convert from source HTML to Mobiledoc',
|
|
context: 'The html-to-mobiledoc package was not installed',
|
|
help: 'Please review any errors from the install process by checking the Ghost logs',
|
|
code: 'HTML_TO_MOBILEDOC_INSTALLATION',
|
|
err: err
|
|
});
|
|
};
|
|
}
|
|
}
|
|
};
|