don't force SiteSetting.title into meta title tag

This commit is contained in:
Neil Lalonde 2017-06-12 13:50:30 -04:00
parent a3729b51eb
commit 0b41046238
13 changed files with 16 additions and 15 deletions

View File

@ -29,7 +29,7 @@ class CategoriesController < ApplicationController
@category_list.draft_sequence = DraftSequence.current(current_user, Draft::NEW_TOPIC)
@category_list.draft = Draft.get(current_user, Draft::NEW_TOPIC, @category_list.draft_sequence) if current_user
@title = I18n.t('js.filters.categories.title') unless category_options[:is_homepage]
@title = "#{I18n.t('js.filters.categories.title')} - #{SiteSetting.title}" unless category_options[:is_homepage]
respond_to do |format|
format.html do

View File

@ -84,6 +84,7 @@ class ListController < ApplicationController
else
@title = I18n.t('js.filters.with_topics', filter: filter_title)
end
@title << " - #{SiteSetting.title}"
end
end
@ -181,7 +182,7 @@ class ListController < ApplicationController
guardian.ensure_can_see!(@category)
discourse_expires_in 1.minute
@title = @category.name
@title = "#{@category.name} - #{SiteSetting.title}"
@link = "#{Discourse.base_url}#{@category.url}"
@atom_link = "#{Discourse.base_url}#{@category.url}.rss"
@description = "#{I18n.t('topics_in_category', category: @category.name)} #{@category.description}"
@ -239,7 +240,7 @@ class ListController < ApplicationController
@rss = "top_#{period}"
if use_crawler_layout?
@title = I18n.t("js.filters.top.#{period}.title")
@title = I18n.t("js.filters.top.#{period}.title") + " - #{SiteSetting.title}"
end
respond_with_list(list)

View File

@ -35,7 +35,7 @@ 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
@title = "#{@topic.title} - #{SiteSetting.title}"
@body = @topic.posts.first.cooked
@faq_overriden = !SiteSetting.faq_url.blank?
render :show, layout: !request.xhr?, formats: [:html]

View File

@ -1,6 +1,6 @@
<% if crawler_layout? %>
<% content_for :title do %><%=t "about" %><% end %>
<% content_for :title do %><%=t "about" %> - <%= SiteSetting.title %><% end %>
<section itemscope itemtype="https://schema.org/AboutPage">
<h1 itemprop="name">

View File

@ -2,7 +2,7 @@
<html lang="<%= SiteSetting.default_locale %>" class="<%= html_classes %>">
<head>
<meta charset="utf-8">
<title><%= content_for?(:title) ? yield(:title) + ' - ' + SiteSetting.title : SiteSetting.title %></title>
<title><%= content_for?(:title) ? yield(:title) : SiteSetting.title %></title>
<meta name="description" content="<%= @description_meta || SiteSetting.site_description %>">
<meta name="discourse_theme_key" content="<%= theme_key %>">
<%= render partial: "layouts/head" %>

View File

@ -2,7 +2,7 @@
<html lang="<%= SiteSetting.default_locale %>">
<head>
<meta charset="utf-8">
<title><%= content_for?(:title) ? yield(:title) + ' - ' + SiteSetting.title : SiteSetting.title %></title>
<title><%= content_for?(:title) ? yield(:title) : SiteSetting.title %></title>
<meta name="description" content="<%= @description_meta || SiteSetting.site_description %>">
<%= render partial: "layouts/head" %>
<%- if rtl? %>

View File

@ -2,7 +2,7 @@
<html lang="<%= SiteSetting.default_locale %>">
<head>
<meta charset="utf-8">
<title><%= content_for?(:title) ? yield(:title) + ' - ' + SiteSetting.title : SiteSetting.title %></title>
<title><%= content_for?(:title) ? yield(:title) : SiteSetting.title %></title>
<meta name="description" content="">
<%= render partial: "layouts/head" %>
<%= render partial: "common/special_font_face" %>

View File

@ -99,7 +99,7 @@
<% if @title %>
<% content_for :title do %><%= @title %><% end %>
<% elsif @category %>
<% content_for :title do %><%= @category.name %><% end %>
<% content_for :title do %><%= @category.name %> - <%= SiteSetting.title %><% end %>
<% elsif params[:page] %>
<% content_for :title do %><%=t 'page_num', num: params[:page].to_i + 1 %><% end %>
<% content_for :title do %><%=t 'page_num', num: params[:page].to_i + 1 %> - <%= SiteSetting.title %><% end %>
<% end %>

View File

@ -1 +1 @@
<% content_for :title do %><%= t 'js.search.results_page' %><% end %>
<% content_for :title do %><%= t 'js.search.results_page' %> - <%= SiteSetting.title %><% end %>

View File

@ -1,6 +1,6 @@
<% if crawler_layout? %>
<% content_for :title do %><%=t "tags.title" %><% end %>
<% content_for :title do %><%=t "tags.title" %> - <%= SiteSetting.title %><% end %>
<h1><%=t "tags.title" %></h1>

View File

@ -100,7 +100,7 @@
<% end %>
<% end %>
<% content_for(:title) { "#{gsub_emoji_to_unicode(@topic_view.page_title)}" } %>
<% content_for(:title) { @title || "#{gsub_emoji_to_unicode(@topic_view.page_title)} - #{SiteSetting.title}" } %>
<% if @topic_view.print %>
<% content_for :after_body do %>

View File

@ -13,7 +13,7 @@
<% end %>
</div>
<% content_for :title do %><%=t "password_reset.title" %><% end %>
<% content_for :title do %><%=t "password_reset.title" %> - <%= SiteSetting.title %><% end %>
<%- content_for(:no_ember_head) do %>
<meta name="referrer" content="never">

View File

@ -13,5 +13,5 @@
<% end %>
<% content_for :title do %>
<%= t("js.user.profile")%> - <%= @user.username %>
<%= t("js.user.profile")%> - <%= @user.username %> - <%= SiteSetting.title %>
<% end %>