mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
b6b299a8f7
no issue - Upgraded ghost-ignition - Use debug from ghost-ignition everywhere in the code base - Remove debug dependency - Fixed random typo in Gruntfile.js
31 lines
863 B
JavaScript
31 lines
863 B
JavaScript
var debug = require('ghost-ignition').debug('themes:loader'),
|
|
config = require('../config'),
|
|
themeList = require('./list'),
|
|
read = require('../utils/packages').read,
|
|
loadAllThemes,
|
|
loadOneTheme;
|
|
|
|
loadAllThemes = function loadAllThemes() {
|
|
return read
|
|
.all(config.getContentPath('themes'))
|
|
.then(function updateThemeList(themes) {
|
|
debug('loading themes', Object.keys(themes));
|
|
|
|
themeList.init(themes);
|
|
});
|
|
};
|
|
|
|
loadOneTheme = function loadOneTheme(themeName) {
|
|
return read
|
|
.one(config.getContentPath('themes'), themeName)
|
|
.then(function (readThemes) {
|
|
debug('loaded one theme', themeName);
|
|
return themeList.set(themeName, readThemes[themeName]);
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
loadAllThemes: loadAllThemes,
|
|
loadOneTheme: loadOneTheme
|
|
};
|