From 77af097ce094331251ff6ed26f84c5ff32304055 Mon Sep 17 00:00:00 2001 From: Maja Komel Date: Tue, 7 May 2019 13:21:54 +0200 Subject: [PATCH] FIX: add short description to title on client side --- app/assets/javascripts/discourse/routes/application.js.es6 | 4 ++++ config/site_settings.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index d596bd8cc75..1bafd2d6e6e 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -22,6 +22,7 @@ function unlessReadOnly(method, message) { const ApplicationRoute = Discourse.Route.extend(OpenComposer, { siteTitle: setting("title"), + shortSiteDescription: setting("short_site_description"), actions: { toggleAnonymous() { @@ -41,6 +42,9 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, { _collectTitleTokens(tokens) { tokens.push(this.get("siteTitle")); + if (window.location.pathname === Discourse.getURL("/")) { + tokens.push(this.get("shortSiteDescription")); + } Discourse.set("_docTitle", tokens.join(" - ")); }, diff --git a/config/site_settings.yml b/config/site_settings.yml index 892897b0c2e..5a928686f0a 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -33,6 +33,7 @@ required: default: "" short_site_description: default: "" + client: true contact_email: client: true default: ""