mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
chore: shorten pagination
This commit is contained in:
@@ -17,14 +17,14 @@ export async function getStaticPaths() {
|
||||
params: { slug: entry.slug },
|
||||
props: {
|
||||
entry,
|
||||
nextPost:
|
||||
next:
|
||||
index + 1 === numberOfPages ? { slug: null, data: null } : haikuEntries[index + 1],
|
||||
prevPost: index === 0 ? {} : haikuEntries[index - 1],
|
||||
prev: index === 0 ? {} : haikuEntries[index - 1],
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry, prevPost, nextPost } = Astro.props;
|
||||
const { entry, prev, next } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout title={`Haiku ${entry.slug}`} header={false} footer={false}>
|
||||
@@ -54,9 +54,9 @@ const { entry, prevPost, nextPost } = Astro.props;
|
||||
</div>
|
||||
</div>
|
||||
<Pagination
|
||||
nextText={`Haiku ${nextPost.slug}`}
|
||||
nextUrl={nextPost.slug && `/haiku/${nextPost.slug}`}
|
||||
previousText={`Haiku ${prevPost.slug}`}
|
||||
previousUrl={prevPost.slug && `/haiku/${prevPost.slug}`}
|
||||
nextText={`Haiku ${next.slug}`}
|
||||
nextUrl={next.slug && `/haiku/${next.slug}`}
|
||||
previousText={`Haiku ${prev.slug}`}
|
||||
previousUrl={prev.slug && `/haiku/${prev.slug}`}
|
||||
/>
|
||||
</BaseLayout>
|
||||
|
||||
@@ -20,16 +20,16 @@ export async function getStaticPaths() {
|
||||
params: { slug: entry.slug },
|
||||
props: {
|
||||
entry,
|
||||
nextPost:
|
||||
next:
|
||||
index + 1 === numberOfPages
|
||||
? { slug: null, data: null }
|
||||
: projectEntries[index + 1],
|
||||
prevPost: index === 0 ? {} : projectEntries[index - 1],
|
||||
prev: index === 0 ? {} : projectEntries[index - 1],
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry, prevPost, nextPost } = Astro.props;
|
||||
const { entry, prev, next } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
---
|
||||
|
||||
@@ -48,9 +48,9 @@ const { Content } = await entry.render();
|
||||
</article>
|
||||
|
||||
<Pagination
|
||||
nextText={nextPost.data?.title}
|
||||
nextUrl={nextPost.slug && `/projects/${nextPost.slug}`}
|
||||
previousText={prevPost.data?.title}
|
||||
previousUrl={prevPost.slug && `/projects/${prevPost.slug}`}
|
||||
nextText={next.data?.title}
|
||||
nextUrl={next.slug && `/projects/${next.slug}`}
|
||||
previousText={prev.data?.title}
|
||||
previousUrl={prev.slug && `/projects/${prev.slug}`}
|
||||
/>
|
||||
</GridLayout>
|
||||
|
||||
Reference in New Issue
Block a user