From dd1cf5ffc7140c81e955c622d8c526daebdec2cc Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 3 Jan 2019 17:52:37 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Aliased=20{{@blog}}=20as=20{{@site}?= =?UTF-8?q?}=20in=20the=20theme=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - we're going to remove @blog in Ghost 3.0 in favour of @site - @site is the theme-layer equivalent of the Content API settings endpoint --- core/server/apps/amp/lib/views/amp.hbs | 4 ++-- core/server/apps/private-blogging/lib/views/private.hbs | 2 +- core/server/apps/subscribers/lib/views/subscribe.hbs | 6 +++--- core/server/services/themes/middleware.js | 7 ++++--- core/server/services/url/utils.js | 2 +- core/server/views/error.hbs | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/core/server/apps/amp/lib/views/amp.hbs b/core/server/apps/amp/lib/views/amp.hbs index fe0cc0fa08..bdeac37ea1 100644 --- a/core/server/apps/amp/lib/views/amp.hbs +++ b/core/server/apps/amp/lib/views/amp.hbs @@ -29,7 +29,7 @@ {{#post}}
@@ -58,7 +58,7 @@ {{/post}} diff --git a/core/server/apps/private-blogging/lib/views/private.hbs b/core/server/apps/private-blogging/lib/views/private.hbs index 8dd4d9def0..13f027a5bb 100644 --- a/core/server/apps/private-blogging/lib/views/private.hbs +++ b/core/server/apps/private-blogging/lib/views/private.hbs @@ -5,7 +5,7 @@ - {{@blog.title}} - Private Site Access + {{@site.title}} - Private Site Access diff --git a/core/server/apps/subscribers/lib/views/subscribe.hbs b/core/server/apps/subscribers/lib/views/subscribe.hbs index 568dc41442..135da03a82 100644 --- a/core/server/apps/subscribers/lib/views/subscribe.hbs +++ b/core/server/apps/subscribers/lib/views/subscribe.hbs @@ -24,7 +24,7 @@
{{subscribe_form @@ -62,7 +62,7 @@

- You've successfully subscribed to {{@blog.title}} + You've successfully subscribed to {{@site.title}} with the email address {{email}}.

{{/if}} diff --git a/core/server/services/themes/middleware.js b/core/server/services/themes/middleware.js index 9c046adee2..86b0cfd7d6 100644 --- a/core/server/services/themes/middleware.js +++ b/core/server/services/themes/middleware.js @@ -45,7 +45,7 @@ themeMiddleware.ensureActiveTheme = function ensureActiveTheme(req, res, next) { themeMiddleware.updateTemplateData = function updateTemplateData(req, res, next) { // Static information, same for every request unless the settings change // @TODO: bind this once and then update based on events? - var blogData = settingsCache.getPublic(), + var siteData = settingsCache.getPublic(), labsData = _.cloneDeep(settingsCache.get('labs')), themeData = {}; @@ -66,7 +66,7 @@ themeMiddleware.updateTemplateData = function updateTemplateData(req, res, next) // Request-specific information // These things are super dependent on the request, so they need to be in middleware // Serve the blog url without trailing slash - blogData.url = urlService.utils.urlFor('home', {secure: req.secure, trailingSlash: false}, true); + siteData.url = urlService.utils.urlFor('home', {secure: req.secure, trailingSlash: false}, true); // Pass 'secure' flag to the view engine // so that templates can choose to render https or http 'url', see url utility @@ -75,7 +75,8 @@ themeMiddleware.updateTemplateData = function updateTemplateData(req, res, next) // @TODO: only do this if something changed? hbs.updateTemplateOptions({ data: { - blog: blogData, + blog: siteData, + site: siteData, labs: labsData, config: themeData } diff --git a/core/server/services/url/utils.js b/core/server/services/url/utils.js index dec5617fb8..1690b3b508 100644 --- a/core/server/services/url/utils.js +++ b/core/server/services/url/utils.js @@ -316,7 +316,7 @@ function urlFor(context, data, absolute) { urlPath = getBlogUrl(secure); // CASE: there are cases where urlFor('home') needs to be returned without trailing - // slash e. g. the `{{@blog.url}}` helper. See https://github.com/TryGhost/Ghost/issues/8569 + // slash e. g. the `{{@site.url}}` helper. See https://github.com/TryGhost/Ghost/issues/8569 if (data && data.trailingSlash === false) { urlPath = urlPath.replace(/\/$/, ''); } diff --git a/core/server/views/error.hbs b/core/server/views/error.hbs index 37872ac55d..392f36531b 100644 --- a/core/server/views/error.hbs +++ b/core/server/views/error.hbs @@ -32,7 +32,7 @@

{{statusCode}}

{{message}}

-
Go to the front page → + Go to the front page →