Bump script ver and refactor md metadata gen
Signed-off-by: Paul W. <lambdapaul@protonmail.com>
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
import Link from "next/link";
|
||||
import { INoteMeta } from "../lib/slug";
|
||||
import NotesInfo from '../public/notes.json';
|
||||
|
||||
function RecentNotes({ notesMeta }: { notesMeta: INoteMeta[] }) {
|
||||
function RecentNotes() {
|
||||
const notes = Object.entries(NotesInfo);
|
||||
return (
|
||||
<div className='block'>
|
||||
<div className='h2'>Recent Notes</div>
|
||||
{notesMeta?.slice(0, 10)
|
||||
.map((note: any) => {
|
||||
return <Link key={note.slug} href={`/notes/${note.slug}`} className={`button link`}>{note.title}</Link>
|
||||
{notes?.slice(0, 10)
|
||||
.map(([slug, note]: any) => {
|
||||
return <Link key={slug} href={`/notes/${slug}`} className={`button link`}>{note.title}</Link>
|
||||
})
|
||||
}
|
||||
{
|
||||
notesMeta.length > 10 &&
|
||||
notes.length > 10 &&
|
||||
<div>
|
||||
<Link href='/notes' className='h5'>More...</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user