mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 18:52:45 +08:00
FIX: improves micro data support
This commit is contained in:
parent
ff06ce4cce
commit
276526e30e
|
@ -1,11 +1,14 @@
|
||||||
<div class='category-list' itemscope itemtype='http://schema.org/ItemList'>
|
<div class='category-list' itemscope itemtype='http://schema.org/ItemList'>
|
||||||
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
|
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
|
||||||
<% @category_list.categories.each do |c| %>
|
<% @category_list.categories.each_with_index do |c, index| %>
|
||||||
<div class='category' itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
<div class='category' itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
||||||
<meta itemprop='url' content='<%= c.url %>'>
|
<meta itemprop='position' content='<%= index %>'>
|
||||||
<h2><a href='<%= c.url %>' itemprop='item'>
|
<meta itemprop='url' content='<%= "#{Discourse.base_url}#{c.url}" %>'>
|
||||||
|
<h2>
|
||||||
|
<a href='<%= "#{Discourse.base_url}#{c.url}" %>' itemprop='item'>
|
||||||
<span itemprop='name'><%= c.name %></span>
|
<span itemprop='name'><%= c.name %></span>
|
||||||
</a></h2>
|
</a>
|
||||||
|
</h2>
|
||||||
<span itemprop='description'><%= c.description&.html_safe %></span>
|
<span itemprop='description'><%= c.description&.html_safe %></span>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -26,19 +26,14 @@
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<% if params[:page].to_i == 0 && @subcategories.present? %>
|
<% if params[:page].to_i == 0 && @subcategories.present? %>
|
||||||
<div itemscope itemtype='http://schema.org/ItemList'>
|
|
||||||
<% @subcategories.each do |subcategory| %>
|
<% @subcategories.each do |subcategory| %>
|
||||||
<div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
|
||||||
<meta itemprop='url' content='<%= subcategory.url %>'>
|
|
||||||
<a href='<%= subcategory.url %>' itemprop='item'>
|
<a href='<%= subcategory.url %>' itemprop='item'>
|
||||||
<span itemprop='name'><%= subcategory.name %></span>
|
<span itemprop='name'><%= subcategory.name %></span>
|
||||||
</a>
|
</a>
|
||||||
<% if subcategory.description.present? %>
|
<% if subcategory.description.present? %>
|
||||||
<span itemprop='description'><%= subcategory.description %></span>
|
<span itemprop='description'><%= subcategory.description %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
<br/>
|
<br/>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -47,8 +42,9 @@
|
||||||
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
|
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
|
||||||
<% @list.topics.each_with_index do |t,i| %>
|
<% @list.topics.each_with_index do |t,i| %>
|
||||||
<div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
<div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
||||||
|
<meta itemprop='position' content='<%= i %>'>
|
||||||
<meta itemprop='url' content='<%= t.url %>'>
|
<meta itemprop='url' content='<%= t.url %>'>
|
||||||
<a href='<%= t.relative_url %>' itemprop='item'>
|
<a href='<%= t.url %>' itemprop='item'>
|
||||||
<span itemprop='name'><%= t.title %></span>
|
<span itemprop='name'><%= t.title %></span>
|
||||||
</a>
|
</a>
|
||||||
<span class="page-links"><%= page_links(t) %></span>
|
<span class="page-links"><%= page_links(t) %></span>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user