Skip to content

Commit

Permalink
fix(gatsby-starter-blog): Use ol for blog post list (#26601)
Browse files Browse the repository at this point in the history
Co-authored-by: Lennart <[email protected]>
  • Loading branch information
marcobiedermann and LekoArts authored Sep 28, 2020
1 parent 23fdadb commit f11de7d
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions starters/blog/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,38 @@ const BlogIndex = ({ data, location }) => {
<Layout location={location} title={siteTitle}>
<SEO title="All posts" />
<Bio />
{posts.map(post => {
const title = post.frontmatter.title || post.fields.slug
return (
<article
key={post.fields.slug}
className="post-list-item"
itemScope
itemType="http://schema.org/Article"
>
<header>
<h2>
<Link to={post.fields.slug} itemProp="url">
<span itemProp="headline">{title}</span>
</Link>
</h2>
<small>{post.frontmatter.date}</small>
</header>
<section>
<p
dangerouslySetInnerHTML={{
__html: post.frontmatter.description || post.excerpt,
}}
itemProp="description"
/>
</section>
</article>
)
})}
<ol style={{ listStyle: `none` }}>
{posts.map(post => {
const title = post.frontmatter.title || post.fields.slug

return (
<li key={post.fields.slug}>
<article
className="post-list-item"
itemScope
itemType="http://schema.org/Article"
>
<header>
<h2>
<Link to={post.fields.slug} itemProp="url">
<span itemProp="headline">{title}</span>
</Link>
</h2>
<small>{post.frontmatter.date}</small>
</header>
<section>
<p
dangerouslySetInnerHTML={{
__html: post.frontmatter.description || post.excerpt,
}}
itemProp="description"
/>
</section>
</article>
</li>
)
})}
</ol>
</Layout>
)
}
Expand Down

0 comments on commit f11de7d

Please sign in to comment.