mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-22 09:13:35 +01:00
fixes
This commit is contained in:
parent
b705afb7e9
commit
2278dfa3db
@ -9,14 +9,10 @@ const PostLead = ({ post, index }) => {
|
||||
const content = post.html
|
||||
const separator = '<!-- more -->'
|
||||
|
||||
if (post.frontmatter.type === 'post') {
|
||||
if (content.includes(separator)) {
|
||||
lead = content.split(separator)[0]
|
||||
} else {
|
||||
lead = content.split('\n')[0]
|
||||
}
|
||||
if (content.includes(separator)) {
|
||||
lead = content.split(separator)[0]
|
||||
} else {
|
||||
return null
|
||||
lead = content.split('\n')[0]
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -31,7 +31,7 @@ const Post = ({ data, location }) => {
|
||||
|
||||
<article className={styles.hentry}>
|
||||
<PostTitle type={type} linkurl={linkurl} title={title} />
|
||||
<PostLead post={post} />
|
||||
{type === 'post' && <PostLead post={post} />}
|
||||
{image && (
|
||||
<PostImage fluid={image.childImageSharp.fluid} alt={title} />
|
||||
)}
|
||||
|
@ -37,9 +37,12 @@ const Posts = ({ data, location, pageContext }) => {
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{type === 'post' && <PostLead post={node} index />}
|
||||
|
||||
{type === 'post' && <PostMore to={slug}>Continue Reading</PostMore>}
|
||||
{type === 'post' && (
|
||||
<Fragment>
|
||||
<PostLead post={node} index />
|
||||
<PostMore to={slug}>Continue Reading</PostMore>
|
||||
</Fragment>
|
||||
)}
|
||||
|
||||
{type === 'link' && (
|
||||
<Fragment>
|
||||
|
Loading…
Reference in New Issue
Block a user