mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-03 20:27:20 +02:00
refactor(v2): improve semantic markup of blog (#2003)
* refactor(v2): improve semantic markup of blog * Refactor/simplify
This commit is contained in:
parent
dda10beea6
commit
dec9c1279c
3 changed files with 20 additions and 26 deletions
|
@ -21,16 +21,13 @@ function BlogListPage(props) {
|
|||
<div className="col col--8 col--offset-2">
|
||||
{items.map(
|
||||
({content: BlogPostContent, metadata: blogPostMetadata}) => (
|
||||
<div
|
||||
className="margin-bottom--xl"
|
||||
key={blogPostMetadata.permalink}>
|
||||
<BlogPostItem
|
||||
key={blogPostMetadata.permalink}
|
||||
frontMatter={BlogPostContent.frontMatter}
|
||||
metadata={blogPostMetadata}
|
||||
truncated>
|
||||
<BlogPostContent />
|
||||
</BlogPostItem>
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
<BlogListPaginator metadata={metadata} />
|
||||
|
|
|
@ -92,13 +92,13 @@ function BlogPostItem(props) {
|
|||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<article className={!isBlogPostPage ? 'margin-bottom--xl' : undefined}>
|
||||
{renderPostHeader()}
|
||||
<article className="markdown">
|
||||
<section className="markdown">
|
||||
<MDXProvider components={MDXComponents}>{children}</MDXProvider>
|
||||
</article>
|
||||
</section>
|
||||
{(tags.length > 0 || truncated) && (
|
||||
<div className="row margin-vert--lg">
|
||||
<footer className="row margin-vert--lg">
|
||||
{tags.length > 0 && (
|
||||
<div className="col">
|
||||
<strong>Tags:</strong>
|
||||
|
@ -121,9 +121,9 @@ function BlogPostItem(props) {
|
|||
</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</footer>
|
||||
)}
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,16 +29,13 @@ function BlogTagsPostPage(props) {
|
|||
<div className="margin-vert--xl">
|
||||
{items.map(
|
||||
({content: BlogPostContent, metadata: blogPostMetadata}) => (
|
||||
<div
|
||||
className="margin-vert--xl"
|
||||
key={blogPostMetadata.permalink}>
|
||||
<BlogPostItem
|
||||
key={blogPostMetadata.permalink}
|
||||
frontMatter={BlogPostContent.frontMatter}
|
||||
metadata={blogPostMetadata}
|
||||
truncated>
|
||||
<BlogPostContent />
|
||||
</BlogPostItem>
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue