From 137dbaf0dca9754c4d9a3bb6745e31ea2c4dcc59 Mon Sep 17 00:00:00 2001 From: Ayke Halder Date: Mon, 30 Jan 2023 08:07:04 +0100 Subject: [PATCH] DEV: declare post position as simple number in structured data (#16231) This replaces the position declared as `#123` with the more simple version `123`. The property position may be of type Integer or Text. A value of type Integer, or more precise of type Text which simply casts to integer, is sufficient here. See: https://schema.org/position In category-view the topic-list already uses this notation for the position of topics: `` --- app/assets/stylesheets/common/base/crawler_layout.scss | 3 +++ app/views/topics/show.html.erb | 2 +- spec/fixtures/onebox/discourse_topic.response | 4 ++-- spec/fixtures/onebox/discourse_topic_reply.response | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/common/base/crawler_layout.scss b/app/assets/stylesheets/common/base/crawler_layout.scss index cedb89fd94..934f4536c8 100644 --- a/app/assets/stylesheets/common/base/crawler_layout.scss +++ b/app/assets/stylesheets/common/base/crawler_layout.scss @@ -191,6 +191,9 @@ body > noscript { [itemprop="position"] { float: left; margin-right: 0.5em; + &:before { + content: "#"; + } } } diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 65c12933c9..aed2a9a722 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -75,7 +75,7 @@ <% else %> <% end %> - #<%= post.post_number %> + <%= post.post_number %>
diff --git a/spec/fixtures/onebox/discourse_topic.response b/spec/fixtures/onebox/discourse_topic.response index 2d79976ba8..59d61bacd7 100644 --- a/spec/fixtures/onebox/discourse_topic.response +++ b/spec/fixtures/onebox/discourse_topic.response @@ -257,7 +257,7 @@ And that too in just over an year, way to go! [boom]"> - #1 + 1
@@ -296,7 +296,7 @@ And that too in just over an year, way to go! [boom]"> - #2 + 2
diff --git a/spec/fixtures/onebox/discourse_topic_reply.response b/spec/fixtures/onebox/discourse_topic_reply.response index 2412540fbe..4e7162e095 100644 --- a/spec/fixtures/onebox/discourse_topic_reply.response +++ b/spec/fixtures/onebox/discourse_topic_reply.response @@ -249,7 +249,7 @@ And that too in just over an year, way to go! [boom]"> - #1 + 1
@@ -288,7 +288,7 @@ And that too in just over an year, way to go! [boom]"> - #2 + 2