2019-08-09 17:11:24 +03:00
|
|
|
const ghostVersion = require('../../lib/ghost-version');
|
|
|
|
const settingsCache = require('../../services/settings/cache');
|
2020-05-28 13:57:02 +03:00
|
|
|
const urlUtils = require('../../../shared/url-utils');
|
2020-05-27 20:47:53 +03:00
|
|
|
const config = require('../../../shared/config');
|
2019-08-09 17:11:24 +03:00
|
|
|
|
|
|
|
const site = {
|
|
|
|
docName: 'site',
|
|
|
|
|
|
|
|
read: {
|
|
|
|
permissions: false,
|
|
|
|
query() {
|
2020-04-27 17:15:56 +03:00
|
|
|
const response = {
|
2019-08-09 17:11:24 +03:00
|
|
|
title: settingsCache.get('title'),
|
2020-04-17 12:30:31 +03:00
|
|
|
description: settingsCache.get('description'),
|
|
|
|
logo: settingsCache.get('logo'),
|
2020-06-23 15:33:57 +03:00
|
|
|
accent_color: settingsCache.get('accent_color'),
|
2019-08-09 17:11:24 +03:00
|
|
|
url: urlUtils.urlFor('home', true),
|
2020-04-30 21:50:40 +03:00
|
|
|
version: ghostVersion.safe
|
2019-08-09 17:11:24 +03:00
|
|
|
};
|
2020-04-27 17:15:56 +03:00
|
|
|
|
2020-06-23 15:33:57 +03:00
|
|
|
// accent_color is currently an experimental feature
|
2020-04-27 17:15:56 +03:00
|
|
|
if (!config.get('enableDeveloperExperiments')) {
|
2020-06-23 15:33:57 +03:00
|
|
|
delete response.accent_color;
|
2020-04-27 17:15:56 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return response;
|
2019-08-09 17:11:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = site;
|