diff --git a/app/controllers/docs/docs_controller.rb b/app/controllers/docs/docs_controller.rb index 4575621..33b588a 100644 --- a/app/controllers/docs/docs_controller.rb +++ b/app/controllers/docs/docs_controller.rb @@ -35,6 +35,7 @@ module Docs respond_to do |format| format.html do + @title = set_title render :get_topic end @@ -53,6 +54,15 @@ module Docs TopicViewSerializer.new(topic_view, scope: guardian, root: false) end + def set_title + title = "#{I18n.t('js.docs.title')} - #{SiteSetting.title}" + if @topic + topic_title = @topic['unicode_title'] || @topic['title'] + title = "#{topic_title} - #{title}" + end + title + end + def topic_in_docs(category, tags) category_match = Docs::Query.categories.include?(category.to_s) tags = tags.pluck(:name) diff --git a/app/views/docs/docs/get_topic.html.erb b/app/views/docs/docs/get_topic.html.erb index cc248bf..c545ded 100644 --- a/app/views/docs/docs/get_topic.html.erb +++ b/app/views/docs/docs/get_topic.html.erb @@ -1,3 +1,5 @@ <% content_for :head do %> <%= raw crawlable_meta_data(title: @topic["title"], description: @excerpt, ignore_canonical: true) if @topic %> <% end %> + +<% content_for(:title) { @title } %>