Paul W.
e3c70632e2
Remove custom html from markdown, clean-up UI (again) Signed-off-by: Paul W. <lambdapaul@protonmail.com>
32 lines
861 B
TypeScript
32 lines
861 B
TypeScript
import Link from "next/link";
|
|
import NotesInfo from '../public/notes.json';
|
|
|
|
function RecentNotes() {
|
|
const notes = Object.entries(NotesInfo).reverse();
|
|
return (
|
|
<ul className='block'>
|
|
<h2>Recent Notes</h2>
|
|
{notes?.slice(0, 5)
|
|
.map(([slug, note]: any, i: number) => {
|
|
return (
|
|
<li
|
|
key={i}
|
|
>
|
|
<Link
|
|
href={`/notes/${slug}`}>
|
|
{note.title}
|
|
</Link>
|
|
</li>
|
|
);
|
|
})
|
|
}
|
|
{
|
|
notes.length > 5 &&
|
|
<Link href='/notes'>More...</Link>
|
|
}
|
|
</ul>
|
|
);
|
|
}
|
|
|
|
export default RecentNotes;
|