mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
35e51e364b
no issue The only pieces of Ghost-Ignition used in Ghost were debug and logging. Both of these modules have been superceded by the Framework monorepo, and all usages of Ignition have now been removed, replaced with @tryghost/debug and @tryghost/logging.
29 lines
892 B
JavaScript
29 lines
892 B
JavaScript
const debug = require('@tryghost/debug')('themes:loader');
|
|
const config = require('../../../shared/config');
|
|
const packageJSON = require('@tryghost/package-json');
|
|
const themeList = require('./list');
|
|
|
|
const loadAllThemes = function loadAllThemes() {
|
|
return packageJSON
|
|
.readPackages(config.getContentPath('themes'))
|
|
.then(function updateThemeList(themes) {
|
|
debug('loading themes', Object.keys(themes));
|
|
|
|
themeList.init(themes);
|
|
});
|
|
};
|
|
|
|
const loadOneTheme = function loadOneTheme(themeName) {
|
|
return packageJSON
|
|
.readPackage(config.getContentPath('themes'), themeName)
|
|
.then(function (readThemes) {
|
|
debug('loaded one theme', themeName);
|
|
return themeList.set(themeName, readThemes[themeName]);
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
loadAllThemes: loadAllThemes,
|
|
loadOneTheme: loadOneTheme
|
|
};
|