mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 09:22:49 +03:00
da4270ce35
- Every route can set a title token that is combined with the blog’s title, resulting in titles like ‘Content - Test Blog’. - Subroutes are supported (‘Settings - General - Test Blog’) - The blog’s name is applied to and taken from the `config` object to spare Ember a REST call via `store.find(‘settings’)`. - Tests have been changed to test for the new titles. - The initially proposed solution (https://github.com/paddle8/ember-document-title) doesn’t play nice with EAK, which is why I went with this solution (https://gist.github.com/machty/8413411) by Ember.JS core dev @Machty.
22 lines
778 B
JavaScript
22 lines
778 B
JavaScript
var ConfigInitializer = {
|
|
name: 'config',
|
|
|
|
initialize: function (container, application) {
|
|
var apps = $('body').data('apps'),
|
|
tagsUI = $('body').data('tagsui'),
|
|
fileStorage = $('body').data('filestorage'),
|
|
blogUrl = $('body').data('blogurl'),
|
|
blogTitle = $('body').data('blogtitle');
|
|
|
|
application.register(
|
|
'ghost:config', {apps: apps, fileStorage: fileStorage, blogUrl: blogUrl, tagsUI: tagsUI, blogTitle: blogTitle}, {instantiate: false}
|
|
);
|
|
|
|
application.inject('route', 'config', 'ghost:config');
|
|
application.inject('controller', 'config', 'ghost:config');
|
|
application.inject('component', 'config', 'ghost:config');
|
|
}
|
|
};
|
|
|
|
export default ConfigInitializer;
|