mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FIX: static page title should be consistent on client side and server side
This commit is contained in:
parent
04558b6ca4
commit
bdb1268528
@ -10,6 +10,7 @@ class AboutController < ApplicationController
|
||||
return redirect_to path('/login') if SiteSetting.login_required? && current_user.nil?
|
||||
|
||||
@about = About.new
|
||||
@title = "#{I18n.t("js.about.simple_title")} - #{SiteSetting.title}"
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render :index
|
||||
|
@ -39,7 +39,12 @@ class StaticController < ApplicationController
|
||||
if map.has_key?(@page)
|
||||
@topic = Topic.find_by_id(SiteSetting.send(map[@page][:topic_id]))
|
||||
raise Discourse::NotFound unless @topic
|
||||
@title = "#{@topic.title} - #{SiteSetting.title}"
|
||||
title_prefix = if I18n.exists?("js.#{@page}")
|
||||
I18n.t("js.#{@page}")
|
||||
else
|
||||
@topic.title
|
||||
end
|
||||
@title = "#{title_prefix} - #{SiteSetting.title}"
|
||||
@body = @topic.posts.first.cooked
|
||||
@faq_overriden = !SiteSetting.faq_url.blank?
|
||||
render :show, layout: !request.xhr?, formats: [:html]
|
||||
|
@ -105,6 +105,13 @@
|
||||
|
||||
<% end %>
|
||||
|
||||
<% content_for :head do %>
|
||||
<%= raw crawlable_meta_data(title: SiteSetting.title, description: SiteSetting.site_description) %>
|
||||
<% if @title %>
|
||||
<% content_for :title do %><%= @title %><% end %>
|
||||
<% content_for :head do %>
|
||||
<%= raw crawlable_meta_data(title: @title, description: SiteSetting.site_description) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% content_for :head do %>
|
||||
<%= raw crawlable_meta_data(title: SiteSetting.title, description: SiteSetting.site_description) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
Loading…
Reference in New Issue
Block a user