Skip to content

Commit f11de7d

Browse files
fix(gatsby-starter-blog): Use ol for blog post list (#26601)
Co-authored-by: Lennart <[email protected]>
1 parent 23fdadb commit f11de7d

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

starters/blog/src/pages/index.js

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,38 @@ const BlogIndex = ({ data, location }) => {
2727
<Layout location={location} title={siteTitle}>
2828
<SEO title="All posts" />
2929
<Bio />
30-
{posts.map(post => {
31-
const title = post.frontmatter.title || post.fields.slug
32-
return (
33-
<article
34-
key={post.fields.slug}
35-
className="post-list-item"
36-
itemScope
37-
itemType="http://schema.org/Article"
38-
>
39-
<header>
40-
<h2>
41-
<Link to={post.fields.slug} itemProp="url">
42-
<span itemProp="headline">{title}</span>
43-
</Link>
44-
</h2>
45-
<small>{post.frontmatter.date}</small>
46-
</header>
47-
<section>
48-
<p
49-
dangerouslySetInnerHTML={{
50-
__html: post.frontmatter.description || post.excerpt,
51-
}}
52-
itemProp="description"
53-
/>
54-
</section>
55-
</article>
56-
)
57-
})}
30+
<ol style={{ listStyle: `none` }}>
31+
{posts.map(post => {
32+
const title = post.frontmatter.title || post.fields.slug
33+
34+
return (
35+
<li key={post.fields.slug}>
36+
<article
37+
className="post-list-item"
38+
itemScope
39+
itemType="http://schema.org/Article"
40+
>
41+
<header>
42+
<h2>
43+
<Link to={post.fields.slug} itemProp="url">
44+
<span itemProp="headline">{title}</span>
45+
</Link>
46+
</h2>
47+
<small>{post.frontmatter.date}</small>
48+
</header>
49+
<section>
50+
<p
51+
dangerouslySetInnerHTML={{
52+
__html: post.frontmatter.description || post.excerpt,
53+
}}
54+
itemProp="description"
55+
/>
56+
</section>
57+
</article>
58+
</li>
59+
)
60+
})}
61+
</ol>
5862
</Layout>
5963
)
6064
}

0 commit comments

Comments
 (0)