FIX: set microdata schema for topic on missing first post (#25195)

Some attributes of the microdata schema `DiscussionForumPosting` are rendered in the context of the first post.
Ensure these attributes are also set if the first post is not part of the current view.
This commit is contained in:
Ayke Halder 2024-01-12 11:59:03 +01:00 committed by GitHub
parent 9261500ea9
commit 1a782acd9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@
<% end %>
</div>
<% if @topic_view.prev_page %>
<% if @topic_view.posts&.first && !@topic_view.posts.first.is_first_post? %>
<span itemprop='author' itemscope itemtype="http://schema.org/Person">
<meta itemprop='name' content='<%= @topic_view.topic.user.username %>'>
<link itemprop='url' href='<%= Discourse.base_url %>/u/<%= @topic_view.topic.user.username %>'>