mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Clean up config (non-env based settings)
closes #625 - removed defaultLang, forceI18n and activePlugins from config - added values to default-settings.json - updated to use values from settings
This commit is contained in:
parent
630c03d4d4
commit
d9fb23496c
16
config.js
16
config.js
@ -3,22 +3,6 @@
|
||||
var path = require('path'),
|
||||
config = {};
|
||||
|
||||
// ## Admin settings
|
||||
|
||||
// Default language
|
||||
config.defaultLang = 'en';
|
||||
|
||||
// Force i18n to be on
|
||||
config.forceI18n = true;
|
||||
|
||||
// ## Plugins
|
||||
|
||||
// Current active plugins
|
||||
config.activePlugins = [
|
||||
'FancyFirstChar'
|
||||
];
|
||||
|
||||
|
||||
// ## Default Navigation Items
|
||||
// Add new objects here to extend the menu output by {{nav}}
|
||||
config.nav = [
|
||||
|
@ -146,11 +146,11 @@ Ghost.prototype.init = function () {
|
||||
instance.mail.init(self)
|
||||
).then(function () {
|
||||
return models.Settings.populateDefaults();
|
||||
}).then(function () {
|
||||
return self.initPlugins();
|
||||
}).then(function () {
|
||||
// Initialize the settings cache
|
||||
return self.updateSettingsCache();
|
||||
}).then(function () {
|
||||
return self.initPlugins();
|
||||
}).then(function () {
|
||||
// Initialize the permissions actions and objects
|
||||
return permissions.init();
|
||||
@ -301,7 +301,7 @@ Ghost.prototype.doFilter = function (name, args, callback) {
|
||||
|
||||
// Initialise plugins. Will load from config.activePlugins by default
|
||||
Ghost.prototype.initPlugins = function (pluginsToLoad) {
|
||||
pluginsToLoad = pluginsToLoad || config.activePlugins;
|
||||
pluginsToLoad = pluginsToLoad || models.Settings.activePlugins;
|
||||
|
||||
var self = this;
|
||||
|
||||
|
@ -44,10 +44,19 @@
|
||||
"value": "",
|
||||
"type": "blog"
|
||||
},
|
||||
{
|
||||
"key": "defaultLang",
|
||||
"value": "en",
|
||||
"type": "blog"
|
||||
},
|
||||
{
|
||||
"key": "forceI18n",
|
||||
"value": true,
|
||||
"type": "blog"
|
||||
},
|
||||
{
|
||||
"key": "postsPerPage",
|
||||
"value": "6",
|
||||
"type": "blog"
|
||||
}
|
||||
|
||||
]
|
||||
|
@ -223,7 +223,7 @@ coreHelpers = function (ghost) {
|
||||
ghost.registerThemeHelper('e', function (key, defaultString, options) {
|
||||
var output;
|
||||
|
||||
if (ghost.config().defaultLang === 'en' && _.isEmpty(options.hash) && !ghost.config().forceI18n) {
|
||||
if (ghost.settings().defaultLang === 'en' && _.isEmpty(options.hash) && !ghost.settings().forceI18n) {
|
||||
output = defaultString;
|
||||
} else {
|
||||
output = ghost.polyglot().t(key, options.hash);
|
||||
|
@ -8,7 +8,7 @@ var fs = require('fs'),
|
||||
I18n = function (ghost) {
|
||||
|
||||
// TODO: validate
|
||||
var lang = ghost.config().defaultLang,
|
||||
var lang = ghost.settings().defaultLang,
|
||||
path = ghost.paths().lang,
|
||||
langFilePath = path + lang + '.json';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user