FEATURE: add short site description on login page title

This commit is contained in:
Arpit Jalan 2019-10-14 11:39:14 +05:30
parent f92a6f7ac5
commit 815edf6f4d
3 changed files with 12 additions and 2 deletions

View File

@ -43,7 +43,8 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, {
_collectTitleTokens(tokens) {
tokens.push(this.siteTitle);
if (
window.location.pathname === Discourse.getURL("/") &&
(window.location.pathname === Discourse.getURL("/") ||
window.location.pathname === Discourse.getURL("/login")) &&
this.shortSiteDescription !== ""
) {
tokens.push(this.shortSiteDescription);

View File

@ -51,6 +51,14 @@ class StaticController < ApplicationController
return
end
unless @title.present?
@title = if SiteSetting.short_site_description.present?
"#{SiteSetting.title} - #{SiteSetting.short_site_description}"
else
SiteSetting.title
end
end
if I18n.exists?("static.#{@page}")
render html: I18n.t("static.#{@page}"), layout: !request.xhr?, formats: [:html]
return

View File

@ -4,6 +4,7 @@
</div>
<% end %>
<% content_for :title do %><%= @title %><% end %>
<% content_for :head do %>
<%= raw crawlable_meta_data(title: SiteSetting.title, description: SiteSetting.site_description) %>
<%= raw crawlable_meta_data(title: @title, description: SiteSetting.site_description) %>
<% end %>