mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #3199 from fantasticfears/seo
FEATURE: add microdata prop and more links for crawler
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
<% @list.categories.each do |c| %>
|
||||
<div class="category">
|
||||
<h2><a href="<%= path ("/c/" << (c.slug.blank? ? c.id : c.slug)) %>"><%= c.name %></a></h2>
|
||||
<div class="topic-list">
|
||||
<%- if c.displayable_topics.present? %>
|
||||
<% c.displayable_topics.each do |t| %>
|
||||
<a href="<%= t.relative_url %>"><%= t.title %></a> <span title='<%= t 'posts' %>'>(<%= t.posts_count %>)</span><br/>
|
||||
<% end %>
|
||||
<%- end %>
|
||||
<div class='category-list' itemscope itemtype='http://schema.org/ItemList'>
|
||||
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
|
||||
<% @list.categories.each do |c| %>
|
||||
<div class='category' itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
||||
<meta itemprop='url' content='<%= c.url %>'>
|
||||
<h2><a href='/c/<%= c.slug.blank? ? c.id : c.slug %>' itemprop='item'>
|
||||
<span itemprop='name'><%= c.name %></span>
|
||||
</a></h2>
|
||||
<span itemprop='description'><%= c.description %></span>
|
||||
<div class='topic-list' itemscope itemtype='http://schema.org/ItemList'>
|
||||
<%- if c.displayable_topics.present? %>
|
||||
<% c.displayable_topics.each do |t| %>
|
||||
<div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
||||
<meta itemprop='url' content='<%= t.url %>'>
|
||||
<a href='<%= t.relative_url %>' itemprop='item'>
|
||||
<span itemprop='name'><%= t.title %></span>
|
||||
</a> <span title='<%= t 'posts' %>'>(<%= t.posts_count %>)</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<%- end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% content_for :title do %><%= I18n.t('js.filters.categories.title') %><% end %>
|
||||
|
||||
@@ -42,7 +42,17 @@
|
||||
<!-- preload-content: -->
|
||||
<%= yield %>
|
||||
<!-- :preload-content -->
|
||||
<footer>
|
||||
<nav itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
||||
<a href='/'><%= t 'home_title' %></a>
|
||||
<%= link_to t('js.filters.categories.title'), categories_path %>
|
||||
<%= link_to t('guidelines_topic.title'), guidelines_path %>
|
||||
<%= link_to t('tos_topic.title'), tos_path %>
|
||||
<%= link_to t('privacy_topic.title'), privacy_path %>
|
||||
</nav>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<footer id='noscript-footer'>
|
||||
<p><%= t 'powered_by_html' %></p>
|
||||
</footer>
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
<%= yield %>
|
||||
</div>
|
||||
<footer class="container">
|
||||
<nav itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
||||
<a href='/'><%= t 'home_title' %></a>
|
||||
<%= link_to t('js.filters.categories.title'), categories_path %>
|
||||
<%= link_to t('guidelines_topic.title'), guidelines_path %>
|
||||
<%= link_to t('tos_topic.title'), tos_path %>
|
||||
<%= link_to t('privacy_topic.title'), privacy_path %>
|
||||
</nav>
|
||||
<p><%= t 'powered_by_html' %></p>
|
||||
</footer>
|
||||
<%= render_google_analytics_code %>
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
<div class="topic-list">
|
||||
<% @list.topics.each do |t| %>
|
||||
<a href="<%= t.relative_url %>"><%= t.title %></a>
|
||||
<% if !@category && t.category %>
|
||||
[<a href="<%= t.category.url%>"><%= t.category.name %></a>]
|
||||
<div class='topic-list' itemscope itemtype='http://schema.org/ItemList'>
|
||||
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
|
||||
<% @list.topics.each_with_index do |t,i| %>
|
||||
<div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
||||
<meta itemprop='url' content='<%= t.url %>'>
|
||||
<a href='<%= t.relative_url %>' itemprop='item'>
|
||||
<span itemprop='name'><%= t.title %></span>
|
||||
</a>
|
||||
<% if !@category && t.category %>
|
||||
<span>[<a href='<%= t.category.url %>'><%= t.category.name %></a>]</span>
|
||||
<% end %>
|
||||
<span title='<%= t 'posts' %>'>(<%= t.posts_count %>)</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<span title='<%= t 'posts' %>'>(<%= t.posts_count %>)</span><br/>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<% if @list.topics.length > 0 && @list.more_topics_url %>
|
||||
<p>
|
||||
<% if params[:page].to_i > 0 %>
|
||||
<a href="<%= @list.prev_topics_url.sub('.json?','?') %>" rel="prev"><%= t 'prev_page'%></a>
|
||||
<% end %>
|
||||
<b><a href="<%= @list.more_topics_url.sub('.json?','?') %>" rel="next"><%= t 'next_page'%></a></b>
|
||||
</p>
|
||||
<div role='navigation' itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
||||
<% if params[:page].to_i > 0 %>
|
||||
<span itemprop='url'><a href='<%= @list.prev_topics_url %>' rel='prev' itemprop='name'><%= t 'prev_page' %></a> </span>
|
||||
<% end %>
|
||||
<span itemprop='url'><b><a href='<%= @list.more_topics_url %>' rel='next' itemprop='name'><%= t 'next_page' %></a></b></span>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @rss %>
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
<ul class="nav-pills">
|
||||
<li class="nav-item-about"><%= link_to t('about'), '/about' %></a></li>
|
||||
<% if @faq_overriden %>
|
||||
<li class="nav-item-guidelines"><a class="<%= @page == 'faq' ? 'active' : '' %>" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
|
||||
<li class="nav-item-faq"><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
|
||||
<% else %>
|
||||
<li class="nav-item-faq"><a class="<%= @page == 'faq' ? 'active' : '' %>" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
|
||||
<div itemscope itemtype='http://schema.org/WebPage'>
|
||||
<meta itemprop='lastReviewed' content='<%= @topic.first_post.updated_at.to_date.to_formatted_s(:iso_8601) %>'>
|
||||
<ul class='nav-pills' role='navigation' itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
||||
<% if @faq_overriden %>
|
||||
<li class='nav-item-guidelines'><a class='<%= @page == 'faq' ? 'active' : '' %>' href='<%= guidelines_path %>'><%= t 'guidelines' %></a></li>
|
||||
<li class='nav-item-faq'><a href='<%= faq_path %>'><%= t 'js.faq' %></a></li>
|
||||
<% else %>
|
||||
<li class='nav-item-faq'><a class='<%= @page == 'faq' ? 'active' : '' %>' href='<%=faq_path%>'><%= t 'js.faq' %></a></li>
|
||||
<% end %>
|
||||
<li class='nav-item-tos'><a href='<%= tos_path %>' class='<%= @page == 'tos' ? 'active' : '' %>'><%= t 'terms_of_service.title' %></a></li>
|
||||
<li class='nav-item-privacy'><a href='<%= privacy_path %>' class='<%= @page == 'privacy' ? 'active' : '' %>'><%= t 'privacy' %></a></li>
|
||||
</ul>
|
||||
|
||||
<% if staff? %>
|
||||
<p><a href='<%= @topic.url %>'><i class='fa fa-pencil'></i> <%= t 'edit_this_page' %></a></p>
|
||||
<% end %>
|
||||
<li class="nav-item-tos"><a href="<%=tos_path%>" class="<%= @page == 'tos' ? 'active' : '' %>"><%=t "terms_of_service.title" %></a></li>
|
||||
<li class="nav-item-privacy"><a href="<%=privacy_path%>" class="<%= @page == 'privacy' ? 'active' : '' %>"><%=t "privacy" %></a></li>
|
||||
</ul>
|
||||
|
||||
<% if staff? %>
|
||||
<p><a href="<%= @topic.url %>"><i class="fa fa-pencil"></i> <%=t "edit_this_page" -%></a></p>
|
||||
<% end %>
|
||||
|
||||
<%= @body.html_safe %>
|
||||
<div itemprop='mainContentOfPage'>
|
||||
<%= @body.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @title %>
|
||||
<% content_for :title do %><%= @title %><% end %>
|
||||
|
||||
@@ -1,40 +1,52 @@
|
||||
<h2>
|
||||
<%= render_topic_title(@topic_view.topic) %>
|
||||
<%= render_topic_title(@topic_view.topic) %>
|
||||
</h2>
|
||||
<% if c = @topic_view.topic.category %>
|
||||
<%= link_to c.name, c.url %>
|
||||
<% end %>
|
||||
<hr/>
|
||||
|
||||
<div itemscope itemtype='http://schema.org/BreadcrumbList'>
|
||||
<% categories_breadcrumb(@topic_view.topic).each_with_index do |c,i| %>
|
||||
<span itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
||||
<%= link_to c[:url], itemprop: 'item' do %>
|
||||
<span itemprop='name'><%= c[:name] %></span>
|
||||
<% end %>
|
||||
</span>
|
||||
<meta itemprop='position' content='<%= i + 1 %>'>
|
||||
<% end %>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<% @topic_view.posts.each do |post| %>
|
||||
<% if post.user %>
|
||||
<div class='creator'>
|
||||
<b><%= post.user.username %></b>
|
||||
<%= "(#{post.user.name})" if (SiteSetting.display_name_on_posts && SiteSetting.enable_names?) %> —
|
||||
<%= post.created_at.to_formatted_s(:iso8601) %> —
|
||||
#<%= post.post_number %>
|
||||
</div>
|
||||
<div class='post'>
|
||||
<% if post.hidden %>
|
||||
<%= t('flagging.user_must_edit').html_safe %>
|
||||
<% else %>
|
||||
<%= post.cooked.html_safe %>
|
||||
<% end %>
|
||||
</div>
|
||||
<hr/>
|
||||
<% end %>
|
||||
<div itemscope itemtype='http://schema.org/Article'>
|
||||
<% if (u = post.user) %>
|
||||
<div class='creator'>
|
||||
<span>
|
||||
<a href='/users/<%= u.username %>'><b itemprop='author'><%= u.username %></b></a>
|
||||
<%= "(#{u.name})" if (SiteSetting.display_name_on_posts && SiteSetting.enable_names? && !u.name.blank?) %>
|
||||
<time datetime='<%= post.created_at.to_formatted_s(:iso8601) %>' itemprop='datePublished'>
|
||||
<%= post.created_at %>
|
||||
</time>
|
||||
</span>
|
||||
<span itemprop='position'>#<%= post.post_number %></span>
|
||||
</div>
|
||||
<div class='post' itemprop='articleBody'>
|
||||
<%= post.hidden ? t('flagging.user_must_edit').html_safe : post.cooked.html_safe %>
|
||||
</div>
|
||||
<meta itemprop='interactionCount' content='UserLikes:<%= post.like_count %>'>
|
||||
<meta itemprop='interactionCount' content='UserComments:<%= post.reply_count %>'>
|
||||
<hr>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<p>
|
||||
<% if @topic_view.prev_page %>
|
||||
<%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev' %>
|
||||
<% end %>
|
||||
<% if @topic_view.next_page %>
|
||||
<b><%= link_to t(:next_page), @topic_view.next_page_path, rel: 'next' %></b>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<% if @topic_view.prev_page || @topic_view.next_page %>
|
||||
<div role='navigation' itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
||||
<% if @topic_view.prev_page %>
|
||||
<span itemprop='url'><%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev', itemprop: 'name' %></span>
|
||||
<% end %>
|
||||
<% if @topic_view.next_page %>
|
||||
<span itemprop='url'><b><%= link_to t(:next_page), @topic_view.next_page_path, rel: 'next', itemprop: 'name' %></b></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% content_for :head do %>
|
||||
<%= auto_discovery_link_tag(@topic_view, {action: :feed, slug: @topic_view.topic.slug, topic_id: @topic_view.topic.id}, title: t('rss_posts_in_topic', topic: @topic_view.title), type: 'application/rss+xml') %>
|
||||
|
||||
Reference in New Issue
Block a user