2026-06-05 14:31:12 -06:00
|
|
|
---
|
|
|
|
|
import Layout from '../layouts/Layout.astro';
|
|
|
|
|
import Notes from '../components/Notes.astro';
|
|
|
|
|
import { type CollectionEntry, getCollection } from 'astro:content';
|
|
|
|
|
|
|
|
|
|
const base = import.meta.env.BASE_URL;
|
|
|
|
|
|
|
|
|
|
/*export async function getStaticPaths({ paginate }) {
|
|
|
|
|
return paginate(notes.map((note: CollectionEntry<'notes'>) => ({
|
|
|
|
|
params: { id: note.id },
|
|
|
|
|
props: { note },
|
|
|
|
|
})), {pageSize: 6});
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
export async function getStaticPaths({ paginate }) {
|
|
|
|
|
const notes = (await getCollection('notes')).sort(
|
|
|
|
|
(a: CollectionEntry<'notes'>, b: CollectionEntry<'notes'>) => b.data.date.valueOf() - a.data.date.valueOf(),
|
2026-06-07 20:29:35 -06:00
|
|
|
).filter((note) => (note.data.published));
|
2026-06-05 14:31:12 -06:00
|
|
|
return paginate(notes, { pageSize: 6 });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const { page } = Astro.props;
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-06-30 15:14:04 -06:00
|
|
|
<Layout title="Just Us: Notes">
|
2026-06-05 14:31:12 -06:00
|
|
|
<Notes notes={page.data} />
|
|
|
|
|
<nav id="pagination">
|
|
|
|
|
<ul>
|
|
|
|
|
{page.url.first ? <li><a href={page.url.first}>« First</a></li> : <li><a class="disabled">« First</a></li>}
|
|
|
|
|
{page.url.prev ? <li><a href={page.url.prev}>‹ Previous</a></li> : <li><a class="disabled">‹ Previous</a></li>}
|
|
|
|
|
{page.url.next ? <li><a href={page.url.next}>Next ›</a></li> : <li><a class="disabled">Next ›</a></li>}
|
|
|
|
|
{page.url.last ? <li><a href={page.url.last}>Last »</a></li> : <li><a class="disabled">Last »</a></li>}
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
</Layout>
|