Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1630 from hswolff/remove-ghost-singleton
Remove ghost.js
- Loading branch information
Showing
15 changed files
with
233 additions
and
297 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Holds all theme configuration information | ||
// that as mostly used by templates and handlebar helpers. | ||
|
||
var when = require('when'), | ||
|
||
// Variables | ||
theme, | ||
themeConfig = {}, | ||
update; | ||
|
||
|
||
function theme() { | ||
return themeConfig; | ||
} | ||
|
||
// We must pass the api and config object | ||
// into this method due to circular dependencies. | ||
// If we were to require the api module here | ||
// there would be a race condition where the ./models/base | ||
// tries to access the config() object before it is created. | ||
// And we can't require('./index') from here because it is circular. | ||
function update(api, config) { | ||
return when.all([ | ||
api.settings.read('title'), | ||
api.settings.read('description'), | ||
api.settings.read('logo'), | ||
api.settings.read('cover') | ||
]).then(function (globals) { | ||
|
||
themeConfig.path = config.paths().path; | ||
|
||
themeConfig.url = config().url; | ||
themeConfig.title = globals[0].value; | ||
themeConfig.description = globals[1].value; | ||
themeConfig.logo = globals[2] ? globals[2].value : ''; | ||
themeConfig.cover = globals[3] ? globals[3].value : ''; | ||
return; | ||
}); | ||
} | ||
|
||
module.exports = theme; | ||
module.exports.update = update; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.