DEV: declare post position as simple number in structured data ()

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:
`<meta itemprop="position" content="123">`
This commit is contained in:
Ayke Halder 2023-01-30 08:07:04 +01:00 committed by GitHub
parent 64f7b97d08
commit 137dbaf0dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions
app
assets/stylesheets/common/base
views/topics
spec/fixtures/onebox

@ -191,6 +191,9 @@ body > noscript {
[itemprop="position"] {
float: left;
margin-right: 0.5em;
&:before {
content: "#";
}
}
}

@ -75,7 +75,7 @@
<% else %>
<meta itemprop='dateModified' content='<%= post.created_at.to_formatted_s(:iso8601) %>'>
<% end %>
<span itemprop='position'>#<%= post.post_number %></span>
<span itemprop='position'><%= post.post_number %></span>
</span>
</div>
<div class='post' itemprop='articleBody'>

@ -257,7 +257,7 @@ And that too in just over an year, way to go! [boom]">
<time itemprop='dateModified' datetime='2015-06-19T06:45:49Z' class='post-time'>
June 19, 2015, 6:45am
</time>
<span itemprop='position'>#1</span>
<span itemprop='position'>1</span>
</span>
</div>
<div class='post' itemprop='articleBody'>
@ -296,7 +296,7 @@ And that too in just over an year, way to go! [boom]">
<time itemprop='datePublished' datetime='2014-02-06T05:27:06Z' class='post-time'>
February 6, 2014, 5:27am
</time>
<span itemprop='position'>#2</span>
<span itemprop='position'>2</span>
</span>
</div>
<div class='post' itemprop='articleBody'>

@ -249,7 +249,7 @@ And that too in just over an year, way to go! [boom]">
<time itemprop='dateModified' datetime='2015-06-19T06:45:49Z' class='post-time'>
June 19, 2015, 6:45am
</time>
<span itemprop='position'>#1</span>
<span itemprop='position'>1</span>
</span>
</div>
<div class='post' itemprop='articleBody'>
@ -288,7 +288,7 @@ And that too in just over an year, way to go! [boom]">
<time itemprop='datePublished' datetime='2014-02-06T05:27:06Z' class='post-time'>
February 6, 2014, 5:27am
</time>
<span itemprop='position'>#2</span>
<span itemprop='position'>2</span>
</span>
</div>
<div class='post' itemprop='articleBody'>