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