mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-05 09:50:34 +03:00
Merge pull request #6548 from ErisDS/config-api
Restructure Configuration API endpoint
This commit is contained in:
commit
ea3bed5911
@ -31,13 +31,13 @@
|
||||
<meta name="msapplication-square150x150logo" content="{{asset "img/medium.png" ghost="true"}}" />
|
||||
<meta name="msapplication-square310x310logo" content="{{asset "img/large.png" ghost="true"}}" />
|
||||
|
||||
{{#each configuration}}
|
||||
<meta name="env-{{this.key}}" content="{{this.value}}" data-type="{{this.type}}" />
|
||||
{{#each configuration as |config key|}}
|
||||
<meta name="env-{{key}}" content="{{config.value}}" data-type="{{config.type}}" />
|
||||
{{/each}}
|
||||
|
||||
{{#unless skip_google_fonts}}
|
||||
{{#if configuration.useGoogleFonts.value}}
|
||||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,700" />
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
|
||||
<link rel="stylesheet" href="{{asset "vendor.css" ghost="true" minifyInProduction="true"}}" />
|
||||
<link rel="stylesheet" href="{{asset "ghost.css" ghost="true" minifyInProduction="true"}}" />
|
||||
|
@ -18,7 +18,7 @@ export default AuthenticatedRoute.extend(styleBody, {
|
||||
|
||||
model() {
|
||||
let cachedConfig = this.get('cachedConfig');
|
||||
let configUrl = this.get('ghostPaths.url').api('configuration');
|
||||
let configUrl = this.get('ghostPaths.url').api('configuration', 'about');
|
||||
|
||||
if (cachedConfig) {
|
||||
return cachedConfig;
|
||||
@ -26,12 +26,8 @@ export default AuthenticatedRoute.extend(styleBody, {
|
||||
|
||||
return this.get('ajax').request(configUrl)
|
||||
.then((configurationResponse) => {
|
||||
let configKeyValues = configurationResponse.configuration;
|
||||
let [cachedConfig] = configurationResponse.configuration;
|
||||
|
||||
cachedConfig = {};
|
||||
configKeyValues.forEach((configKeyValue) => {
|
||||
cachedConfig[configKeyValue.key] = configKeyValue.value;
|
||||
});
|
||||
this.set('cachedConfig', cachedConfig);
|
||||
|
||||
return cachedConfig;
|
||||
|
Loading…
Reference in New Issue
Block a user