fix(v2): replace h1 tag with h2 in blog list pages (#1987)

This commit is contained in:
Alexey Pyltsyn 2019-11-14 02:41:54 +03:00 committed by Yangshun Tay
parent ae1dec543e
commit 0f0352d5b7

View file

@ -26,6 +26,7 @@ function BlogPostItem(props) {
const {author, authorURL, authorTitle, authorFBID, title} = frontMatter; const {author, authorURL, authorTitle, authorFBID, title} = frontMatter;
const renderPostHeader = () => { const renderPostHeader = () => {
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
const match = date.substring(0, 10).split('-'); const match = date.substring(0, 10).split('-');
const year = match[0]; const year = match[0];
const month = [ const month = [
@ -50,9 +51,10 @@ function BlogPostItem(props) {
return ( return (
<header> <header>
<h1 className={classnames('margin-bottom--sm', styles.blogPostTitle)}> <TitleHeading
className={classnames('margin-bottom--sm', styles.blogPostTitle)}>
{isBlogPostPage ? title : <Link to={permalink}>{title}</Link>} {isBlogPostPage ? title : <Link to={permalink}>{title}</Link>}
</h1> </TitleHeading>
<div className="margin-bottom--sm"> <div className="margin-bottom--sm">
<time dateTime={date} className={styles.blogPostDate}> <time dateTime={date} className={styles.blogPostDate}>
{month} {day}, {year} {month} {day}, {year}