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(v1): fix page title render issue when referred by search result #1869

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/docusaurus-1.x/lib/core/Doc.js
Expand Up @@ -238,7 +238,9 @@ class Doc extends React.Component {
<header className="postHeader">
{editLink}
{!this.props.hideTitle && (
<h1 className="postHeaderTitle">{this.props.title}</h1>
<h1 id="__docusaurus" className="postHeaderTitle">
lex111 marked this conversation as resolved.
Show resolved Hide resolved
{this.props.title}
</h1>
)}
</header>
<article>
Expand Down
22 changes: 22 additions & 0 deletions packages/docusaurus-1.x/lib/static/css/main.css
Expand Up @@ -653,6 +653,16 @@ blockquote {
padding: 0;
}

.mainContainer .wrapper .post .postHeader:before,
.mainContainer .wrapper .post .postHeaderTitle:before {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused a CSS regression bug in which Blog post "Read more" doesnt work anymore

https://deploy-preview-1869--docusaurus-preview.netlify.com/blog/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @yangshun for the quick fix

content: "";
display: block;
height: 90px; /* fixed header height and empty space below it */
margin-top: -90px; /* negative fixed header height and empty space below it */
visibility: hidden;
pointer-events: none;
}

.mainContainer .wrapper .post .postSocialPlugins {
padding-top: 1em;
}
Expand Down Expand Up @@ -714,6 +724,18 @@ blockquote {
width: 100%;
}
}

@media only screen and (max-width: 1023px) {
.mainContainer .wrapper .post .postHeader:before,
.mainContainer .wrapper .post .postHeaderTitle:before {
content: "";
display: block;
height: 200px; /* fixed header height and empty space below it */
margin-top: -200px; /* negative fixed header height and empty space below it */
visibility: hidden;
pointer-events: none;
}
}
/* End of Main Container */

/* Navbar */
Expand Down