1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-31 17:17:46 +01:00

limit posts

This commit is contained in:
Matthias Kretschmann 2021-02-28 23:45:27 +01:00
parent 636557319a
commit be6af0993b
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -14,14 +14,14 @@ export default function Home({ data }: PageProps): ReactElement {
<section className={styles.section}>
<div className={styles.articles}>
{(data as any).latestArticles.edges
.slice(0, 4)
.slice(0, 2)
.map(({ node }: { node: Post }) => (
<PostTeaser key={node.id} post={node} hideDate />
))}
</div>
<div className={`${styles.articles} ${styles.articlesLast}`}>
{(data as any).latestArticles.edges
.slice(4, 7)
.slice(2, 5)
.map(({ node }: { node: Post }) => (
<PostTeaser key={node.id} post={node} hideDate />
))}
@ -48,7 +48,7 @@ export const homeQuery = graphql`
latestArticles: allMarkdownRemark(
filter: { fields: { type: { ne: "photo" } } }
sort: { order: DESC, fields: [fields___date] }
limit: 8
limit: 5
) {
edges {
node {