1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-01-05 19:25:40 +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}> <section className={styles.section}>
<div className={styles.articles}> <div className={styles.articles}>
{(data as any).latestArticles.edges {(data as any).latestArticles.edges
.slice(0, 4) .slice(0, 2)
.map(({ node }: { node: Post }) => ( .map(({ node }: { node: Post }) => (
<PostTeaser key={node.id} post={node} hideDate /> <PostTeaser key={node.id} post={node} hideDate />
))} ))}
</div> </div>
<div className={`${styles.articles} ${styles.articlesLast}`}> <div className={`${styles.articles} ${styles.articlesLast}`}>
{(data as any).latestArticles.edges {(data as any).latestArticles.edges
.slice(4, 7) .slice(2, 5)
.map(({ node }: { node: Post }) => ( .map(({ node }: { node: Post }) => (
<PostTeaser key={node.id} post={node} hideDate /> <PostTeaser key={node.id} post={node} hideDate />
))} ))}
@ -48,7 +48,7 @@ export const homeQuery = graphql`
latestArticles: allMarkdownRemark( latestArticles: allMarkdownRemark(
filter: { fields: { type: { ne: "photo" } } } filter: { fields: { type: { ne: "photo" } } }
sort: { order: DESC, fields: [fields___date] } sort: { order: DESC, fields: [fields___date] }
limit: 8 limit: 5
) { ) {
edges { edges {
node { node {