11---
22import {render } from " astro:content" ;
33
4- import Layout from " ./_layouts/CurationBaseLayout.astro" ;
54import {fm } from " @helpers/frontmatter" ;
6-
5+ import PaginationNavigatorBar from " @components/PaginationNavigatorBar " ;
76import {getCurationCollectionPaginated } from " @helpers/collections/curation" ;
87
8+ import Layout from " ./_layouts/CurationBaseLayout.astro" ;
9+
910import " ./_index.css" ;
1011
1112const groups = (await getCurationCollectionPaginated ()).groups ;
1213const posts = groups [0 ];
1314if (! posts ) throw new Error ();
1415
16+ const mockedPage = {
17+ currentPage: 1 ,
18+ lastPage: groups .length ,
19+ url: {
20+ current: " /curation/" ,
21+ prev: undefined ,
22+ next: " /curation/2/" ,
23+ first: undefined ,
24+ last: ` /curation/${groups .length }/ ` ,
25+ },
26+ };
27+ function numToURL(i : number ): string {
28+ return ` /curation/${i }/ ` ;
29+ }
30+
1531export const frontmatter = fm ({
1632 title: " Sim's Internet Curation" ,
1733 description: " A hand-curated feed of internet content." ,
@@ -24,9 +40,10 @@ export const frontmatter = fm({
2440<div id =" welcome" >
2541 <p ><a href =" ./about/" >About This Page</a ></p >
2642 <p ><em >Disclaimer: Posts shown here or any commentary I write may contain factual errors or imbalanced representation.</em ></p >
27- <p ><a href =" ./2/" >Next Page</a ></p >
2843</div >
2944
45+ <PaginationNavigatorBar page ={ mockedPage } numberToURL ={ numToURL } />
46+
3047{ posts .map (async (p ) => {
3148 const renderedContent = await (async ()=> {
3249 if (! p .collectionEntry ) return null ;
@@ -47,6 +64,8 @@ export const frontmatter = fm({
4764 </article >
4865})}
4966
67+ <PaginationNavigatorBar page ={ mockedPage } numberToURL ={ numToURL } />
68+
5069
5170</Layout >
5271
0 commit comments