add schema.org metatags

This commit is contained in:
r888888888
2016-02-09 14:02:47 -08:00
parent 0f0917210e
commit 2dd4b4cbff
6 changed files with 18 additions and 12 deletions

View File

@@ -21,7 +21,7 @@ class PostPresenter < Presenter
path = options[:path_prefix] || "/posts"
html = %{<article id="post_#{post.id}" class="#{preview_class(post, options[:pool])}" #{data_attributes(post)}>}
html = %{<article itemscope itemtype="http://schema.org/ImageObject" id="post_#{post.id}" class="#{preview_class(post, options[:pool])}" #{data_attributes(post)}>}
if options[:tags].present?
tag_param = "?tags=#{CGI::escape(options[:tags])}"
elsif options[:pool_id] || options[:pool]
@@ -32,7 +32,7 @@ class PostPresenter < Presenter
tag_param = nil
end
html << %{<a href="#{path}/#{post.id}#{tag_param}">}
html << %{<img src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
html << %{<img itemprop="thumbnailUrl" src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
html << %{</a>}
if options[:pool]