Add posts and old grade-calc

Fix small bugs
>bad commit
This commit is contained in:
2022-02-14 15:32:58 -05:00
parent 3e6a540fce
commit a40f30f5ec
21 changed files with 1047 additions and 267 deletions
+32
View File
@@ -0,0 +1,32 @@
import Link from 'next/link';
import React from 'react';
import Layout from '../../components/layout';
import { getAllPosts } from '../../lib/slug';
import Pages from '../../public/pages.json';
import cachePostLinkData from '../../util/post-cache';
function HomePage({posts}: any) {
Pages.sort((x, y) => { return ('' + x.title).localeCompare(y.title) });
return (
<Layout name='Posts'>
{posts.map((post: any) => {
return <section key='' className='h5 block'>
<Link href={`posts/${post.slug}`}>
{post.title}
</Link>
<div>[{ (new Date(post.last_updated)).toLocaleString()}]</div>
</section>
})}
</Layout>
)
}
export async function getStaticProps() {
return {
props: {posts: cachePostLinkData()}
};
}
export default HomePage;