mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 09:27:04 +02:00
fix(v2): replace h1 tag with h2 in blog list pages (#1987)
This commit is contained in:
parent
ae1dec543e
commit
0f0352d5b7
1 changed files with 4 additions and 2 deletions
|
@ -26,6 +26,7 @@ function BlogPostItem(props) {
|
|||
const {author, authorURL, authorTitle, authorFBID, title} = frontMatter;
|
||||
|
||||
const renderPostHeader = () => {
|
||||
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
|
||||
const match = date.substring(0, 10).split('-');
|
||||
const year = match[0];
|
||||
const month = [
|
||||
|
@ -50,9 +51,10 @@ function BlogPostItem(props) {
|
|||
|
||||
return (
|
||||
<header>
|
||||
<h1 className={classnames('margin-bottom--sm', styles.blogPostTitle)}>
|
||||
<TitleHeading
|
||||
className={classnames('margin-bottom--sm', styles.blogPostTitle)}>
|
||||
{isBlogPostPage ? title : <Link to={permalink}>{title}</Link>}
|
||||
</h1>
|
||||
</TitleHeading>
|
||||
<div className="margin-bottom--sm">
|
||||
<time dateTime={date} className={styles.blogPostDate}>
|
||||
{month} {day}, {year}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue