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 },
|
params: { slug: entry.slug },
|
||||||
props: {
|
props: {
|
||||||
entry,
|
entry,
|
||||||
nextPost:
|
next:
|
||||||
index + 1 === numberOfPages ? { slug: null, data: null } : haikuEntries[index + 1],
|
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}>
|
<BaseLayout title={`Haiku ${entry.slug}`} header={false} footer={false}>
|
||||||
@@ -54,9 +54,9 @@ const { entry, prevPost, nextPost } = Astro.props;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Pagination
|
<Pagination
|
||||||
nextText={`Haiku ${nextPost.slug}`}
|
nextText={`Haiku ${next.slug}`}
|
||||||
nextUrl={nextPost.slug && `/haiku/${nextPost.slug}`}
|
nextUrl={next.slug && `/haiku/${next.slug}`}
|
||||||
previousText={`Haiku ${prevPost.slug}`}
|
previousText={`Haiku ${prev.slug}`}
|
||||||
previousUrl={prevPost.slug && `/haiku/${prevPost.slug}`}
|
previousUrl={prev.slug && `/haiku/${prev.slug}`}
|
||||||
/>
|
/>
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ export async function getStaticPaths() {
|
|||||||
params: { slug: entry.slug },
|
params: { slug: entry.slug },
|
||||||
props: {
|
props: {
|
||||||
entry,
|
entry,
|
||||||
nextPost:
|
next:
|
||||||
index + 1 === numberOfPages
|
index + 1 === numberOfPages
|
||||||
? { slug: null, data: null }
|
? { slug: null, data: null }
|
||||||
: projectEntries[index + 1],
|
: 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();
|
const { Content } = await entry.render();
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -48,9 +48,9 @@ const { Content } = await entry.render();
|
|||||||
</article>
|
</article>
|
||||||
|
|
||||||
<Pagination
|
<Pagination
|
||||||
nextText={nextPost.data?.title}
|
nextText={next.data?.title}
|
||||||
nextUrl={nextPost.slug && `/projects/${nextPost.slug}`}
|
nextUrl={next.slug && `/projects/${next.slug}`}
|
||||||
previousText={prevPost.data?.title}
|
previousText={prev.data?.title}
|
||||||
previousUrl={prevPost.slug && `/projects/${prevPost.slug}`}
|
previousUrl={prev.slug && `/projects/${prev.slug}`}
|
||||||
/>
|
/>
|
||||||
</GridLayout>
|
</GridLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user