FIX: add required metadata schema for subsequent pages (#25102)

This commits adds missing metadata schema for subsequent pages (?page=2)

https://meta.discourse.org/t/discussion-forum-schema-improvements/287347/21
This commit is contained in:
Arpit Jalan 2024-01-03 09:37:04 +05:30 committed by GitHub
parent dc263b5189
commit fb056ae719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,15 @@
<% end %>
</div>
<% if @topic_view.prev_page %>
<meta itemprop='datePublished' content='<%= @topic_view.topic.created_at.to_formatted_s(:iso8601) %>'>
<span itemprop='author' itemscope itemtype="http://schema.org/Person">
<link itemprop='url' href='<%= @topic_view.topic.user.username %>'>
<meta itemprop='name' content='<%= Discourse.base_url %>/u/<%= @topic_view.topic.user.username %>'>
</span>
<meta itemprop='text' content='<%= @topic_view.topic.excerpt %>'>
<% end %>
<% @topic_view.posts.each do |post| %>
<% if (u = post.user) %>
<div id='post_<%= post.post_number %>' <%= post.is_first_post? ? "" : "itemprop='comment' itemscope itemtype='http://schema.org/Comment'".html_safe %> class='topic-body crawler-post'>