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

@@ -1,3 +1,3 @@
<% if post.visible? %>
<%= image_tag(post.file_url_for(CurrentUser.user), :width => post.image_width_for(CurrentUser.user), :height => post.image_height_for(CurrentUser.user), :id => "image", "data-original-width" => post.image_width, "data-original-height" => post.image_height, "data-large-width" => post.large_image_width, "data-large-height" => post.large_image_height, "data-tags" => post.tag_string, "data-uploader" => post.uploader_name, "data-rating" => post.rating, "data-flags" => post.status_flags, "data-parent-id" => post.parent_id, "data-has-children" => post.has_children?, "data-has-active-children" => post.has_active_children?, "data-score" => post.score, "data-fav-count" => post.fav_count) %>
<%= image_tag(post.file_url_for(CurrentUser.user), :width => post.image_width_for(CurrentUser.user), :height => post.image_height_for(CurrentUser.user), :id => "image", "data-original-width" => post.image_width, "data-original-height" => post.image_height, "data-large-width" => post.large_image_width, "data-large-height" => post.large_image_height, "data-tags" => post.tag_string, "data-uploader" => post.uploader_name, "data-rating" => post.rating, "data-flags" => post.status_flags, "data-parent-id" => post.parent_id, "data-has-children" => post.has_children?, "data-has-active-children" => post.has_active_children?, "data-score" => post.score, "data-fav-count" => post.fav_count, "itemprop" => "contentUrl") %>
<% end %>

View File

@@ -1,14 +1,17 @@
<ul>
<ul itemscope itemtype="http://schema.org">
<li>ID: <%= post.id %></li>
<li>Uploader: <%= link_to_user(post.uploader) + "&nbsp;".html_safe + link_to("&raquo;".html_safe, posts_path(:tags => "user:#{post.uploader.name}"), :rel => "nofollow") %></li>
<li>Date: <%= link_to time_ago_in_words_tagged(post.created_at), posts_path(:tags => "date:#{post.created_at.to_date}"), :rel => "nofollow" %></li>
<li>
Date: <%= link_to time_ago_in_words_tagged(post.created_at), posts_path(:tags => "date:#{post.created_at.to_date}"), :rel => "nofollow" %>
<meta itemprop="uploadDate" content="<%= post.created_at.iso8601 %>">
</li>
<% if post.approver %>
<li>Approver: <%= link_to_user(post.approver) %></li>
<% end %>
<li>
Size: <%= link_to_if post.visible?, number_to_human_size(post.file_size), post.file_url %>
Size: <%= link_to_if post.visible?, number_to_human_size(post.file_size), post.file_url, :itemprop => "contentSize" %>
<% if post.has_dimensions? %>
(<%= post.image_width %>x<%= post.image_height %>)
(<span itemprop="width"><%= post.image_width %></span>x<span itemprop="height"><%= post.image_height %></span>)
<% end %>
</li>
<li>Source: <%= post_source_tag(post) %></li>

View File

@@ -40,7 +40,7 @@
<%= render "posts/partials/show/notices", :post => @post %>
<section id="image-container" <%= PostPresenter.data_attributes(@post) %>>
<section itemscope itemtype="http://schema.org/ImageObject" id="image-container" <%= PostPresenter.data_attributes(@post) %>>
<div id="note-container"></div>
<div id="note-preview"></div>
<%= @post.presenter.image_html(self) %>