From 28e1d91a9bc4dd92766269fadf74d8cbbab82bd8 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Thu, 14 Jul 2022 07:47:56 +0200 Subject: [PATCH] [site/theme,#140][s]: navbar notes link goes to /all. * remove pages/notes.js as we have /all page and current notes page is similar to front page now. --- site/config/navLinks.js | 2 +- site/pages/notes.js | 68 ----------------------------------------- 2 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 site/pages/notes.js diff --git a/site/config/navLinks.js b/site/config/navLinks.js index 8bba04d..fe7baa9 100644 --- a/site/config/navLinks.js +++ b/site/config/navLinks.js @@ -3,7 +3,7 @@ const navLinks = [ { href: '/guide', name: 'Guide' }, { href: '/claims', name: 'Claims' }, { href: '/library', name: 'Library' }, - { href: '/notes', name: 'Notes' }, + { href: '/all', name: 'Notes' }, { href: '/webinars', name: 'Webinars' }, { href: '/contribute', name: 'Contribute' }, ] diff --git a/site/pages/notes.js b/site/pages/notes.js deleted file mode 100644 index 7472e48..0000000 --- a/site/pages/notes.js +++ /dev/null @@ -1,68 +0,0 @@ -import Link from "next/link"; -import { allOtherPages } from "contentlayer/generated" -import { YOUTUBE_ID_REGEX } from "lib/constants"; - -export async function getStaticProps() { - const posts = allOtherPages - .filter((page) => page._raw.sourceFileDir === "notes") - .map((page) => { - return { - title: page.title || null, - description: page.description || null, - date: page.date, - image: page.image || null, - youtube: page.youtube || null, - link: `/${page._raw.flattenedPath}`, - }; - }) - .sort((a, b) => new Date(b.date) - new Date(a.date)); - - return { props: { posts } }; -} - -export default function Notes({ posts }) { - return ( -
-
-
-

- Our latest articles and explorations. -

-
-
- {posts && posts.map(({ title, description, image, youtube, link }) => ( - title && description && - (
-
- {image && {title}} -
- -
) - ))} -
-
-
- ); -} \ No newline at end of file