added lightyears font to feed
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { entries } from './feed';
|
||||
|
||||
interface FeedEntry {
|
||||
content: any;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
date: string;
|
||||
}
|
||||
|
||||
let entriesPerPage = 8;
|
||||
|
||||
export async function load({ params, url }) {
|
||||
@@ -11,7 +18,7 @@ export async function load({ params, url }) {
|
||||
|
||||
// TODO check if index exceeds maximum permitted and redirect (to max page?)
|
||||
|
||||
let contents = [];
|
||||
let feedEntries: FeedEntry[] = [];
|
||||
let start = (pageIndex - 1) * entriesPerPage;
|
||||
|
||||
for (let i = start; i < start + entriesPerPage; i += 1) {
|
||||
@@ -22,8 +29,14 @@ export async function load({ params, url }) {
|
||||
// Vite complains if I don't do this even though it's stupid
|
||||
const path = entries[i].split("/");
|
||||
const page = await import(`./${path[0]}/${path[1]}.md`);
|
||||
const md = page.metadata;
|
||||
|
||||
contents.push(page.default);
|
||||
feedEntries.push({
|
||||
content: page.default,
|
||||
title: md.title,
|
||||
subtitle: md.subtitle,
|
||||
date: md.date,
|
||||
});
|
||||
}
|
||||
|
||||
let currentPage = pageIndex;
|
||||
@@ -32,6 +45,6 @@ export async function load({ params, url }) {
|
||||
return {
|
||||
currentPage,
|
||||
maxPages,
|
||||
contents,
|
||||
feedEntries,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user