Update readme, about, and some minor things

Signed-off-by: Paul W. <lambdapaul@protonmail.com>
This commit is contained in:
2024-04-20 15:51:07 -04:00
parent e3c70632e2
commit 13be540ebd
11 changed files with 78 additions and 65 deletions

View File

@@ -2,20 +2,28 @@ import Link from "next/link";
import NotesInfo from '../public/notes.json';
function RecentNotes() {
const notes = Object.entries(NotesInfo).reverse();
const notes = Object.entries(NotesInfo)
.map(([slug, note]) => {
return {
slug,
title: note.title,
mtime: new Date(note.mtime)
}
})
.sort(
(a, b) => {
return b.mtime.getTime() - a.mtime.getTime();
}
);
return (
<ul className='block'>
<div className='block'>
<h2>Recent Notes</h2>
<ul>
{notes?.slice(0, 5)
.map(([slug, note]: any, i: number) => {
.map(({slug, title, mtime}) => {
return (
<li
key={i}
>
<Link
href={`/notes/${slug}`}>
{note.title}
</Link>
<li key={mtime.getTime()} >
<Link href={`/notes/${slug}`}>{title}</Link>
</li>
);
})
@@ -25,6 +33,7 @@ function RecentNotes() {
<Link href='/notes'>More...</Link>
}
</ul>
</div>
);
}