mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Merge pull request #156 from javorszky/iss112
Replaced config.blogData with settings
This commit is contained in:
commit
aedd9d7131
2 changed files with 18 additions and 13 deletions
11
config.js
11
config.js
|
@ -12,15 +12,6 @@
|
||||||
*/
|
*/
|
||||||
var config = {};
|
var config = {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Blog settings
|
|
||||||
*/
|
|
||||||
config.blogData = {
|
|
||||||
url: 'http://local.tryghost.org', //'http://john.onolan.org',
|
|
||||||
title: "Ghost Development",
|
|
||||||
description: "Interactive designer, public speaker, startup advisor and writer. Living in Austria, attempting world domination via keyboard."
|
|
||||||
};
|
|
||||||
// ## Admin settings
|
// ## Admin settings
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -109,4 +100,4 @@
|
||||||
* @property {Object} exports
|
* @property {Object} exports
|
||||||
*/
|
*/
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -121,9 +121,23 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Ghost.prototype.init = function () {
|
Ghost.prototype.init = function () {
|
||||||
this.globalConfig = config.blogData;
|
var settings = {},
|
||||||
|
self = this,
|
||||||
|
configDeferred = when.defer(),
|
||||||
|
configPromise = configDeferred.promise;
|
||||||
|
|
||||||
return when.all([instance.dataProvider.init(), instance.getPaths()]);
|
models.Settings.findAll().then(function (result) {
|
||||||
|
_.map(result.models, function (member) {
|
||||||
|
if (!settings.hasOwnProperty(member.attributes.key)) {
|
||||||
|
settings[member.attributes.key] = member.attributes.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
configDeferred.resolve(settings);
|
||||||
|
});
|
||||||
|
return when.all([instance.dataProvider.init(), instance.getPaths(), configPromise]).then(function (results) {
|
||||||
|
self.globalConfig = results[2];
|
||||||
|
return;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -230,4 +244,4 @@
|
||||||
// Ghost.defaults = defaults;
|
// Ghost.defaults = defaults;
|
||||||
|
|
||||||
module.exports = Ghost;
|
module.exports = Ghost;
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Add table
Reference in a new issue