mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Use topic excerpts and category desriptions in meta description tags for crawlers
This commit is contained in:
parent
ac21bc9baa
commit
63a1f87806
4 changed files with 4 additions and 2 deletions
|
@ -252,6 +252,7 @@ class ListController < ApplicationController
|
|||
end
|
||||
|
||||
@category = Category.query_category(slug_or_id, parent_category_id)
|
||||
@description_meta = @category.description
|
||||
|
||||
guardian.ensure_can_see!(@category)
|
||||
|
||||
|
|
|
@ -373,6 +373,7 @@ class TopicsController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
@description_meta = @topic_view.topic.excerpt
|
||||
store_preloaded("topic_#{@topic_view.topic.id}", MultiJson.dump(topic_view_serializer))
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<title><%= content_for?(:title) ? yield(:title) + ' - ' + SiteSetting.title : SiteSetting.title %></title>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<meta content="<%= SiteSetting.site_description %>" name="description">
|
||||
<meta content="<%= @description_meta || SiteSetting.site_description %>" name="description">
|
||||
<meta content="" name="author">
|
||||
|
||||
<%- if SiteSetting.enable_escaped_fragments? %>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<title><%= content_for?(:title) ? yield(:title) + ' - ' + SiteSetting.title : SiteSetting.title %></title>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<meta content="<%= SiteSetting.site_description %>" name="description">
|
||||
<meta content="<%= @description_meta || SiteSetting.site_description %>" name="description">
|
||||
<meta content="" name="author">
|
||||
|
||||
<%= canonical_link_tag %>
|
||||
|
|
Loading…
Reference in a new issue