Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): remove empty containers when no data in blog pages #1963

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ function BlogPostItem(props) {
<article className="markdown">
<MDXProvider components={MDXComponents}>{children}</MDXProvider>
</article>
<div className="row margin-vert--lg">
<div className="col">
{(tags.length > 0 || truncated) && (
<div className="row margin-vert--lg">
{tags.length > 0 && (
<>
<div className="col">
<strong>Tags:</strong>
{tags.map(({label, permalink: tagPermalink}) => (
<Link
Expand All @@ -102,17 +102,17 @@ function BlogPostItem(props) {
{label}
</Link>
))}
</>
</div>
)}
</div>
<div className="col text--right">
{truncated && (
<Link to={metadata.permalink}>
<strong>Read More</strong>
</Link>
<div className="col text--right">
<Link to={metadata.permalink}>
<strong>Read More</strong>
</Link>
</div>
)}
</div>
</div>
)}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ function BlogPostPage(props) {
<BlogPostItem frontMatter={frontMatter} metadata={metadata}>
<BlogPostContents />
</BlogPostItem>
<div className="margin-vert--xl">
<BlogPostPaginator
nextItem={metadata.nextItem}
prevItem={metadata.prevItem}
/>
</div>
{(metadata.nextItem || metadata.prevItem) && (
<div className="margin-vert--xl">
<BlogPostPaginator
nextItem={metadata.nextItem}
prevItem={metadata.prevItem}
/>
</div>
)}
</div>
</div>
</div>
Expand Down