From 1179cc3c1fa0f877406fd06212421ac24bcb88f1 Mon Sep 17 00:00:00 2001 From: Defectink Date: Tue, 22 Mar 2022 17:03:35 +0800 Subject: [PATCH] Add fetch post list * add gray-matter --- components/NavBar.tsx | 6 +++--- lib/utils/constant.ts | 4 ++++ lib/utils/index.ts | 12 ++++++++++++ package.json | 1 + pages/api/posts.ts | 38 ++++++++++++++++++++++++++++++++++++++ pages/blog.tsx | 39 ++++++++++++++++++++++++++++++++++++--- pages/p/first-post.mdx | 6 ++++++ types/index.ts | 10 ++++++++++ yarn.lock | 40 ++++++++++++++++++++++++++++++++++++++++ 9 files changed, 150 insertions(+), 6 deletions(-) create mode 100644 lib/utils/constant.ts create mode 100644 lib/utils/index.ts create mode 100644 pages/api/posts.ts diff --git a/components/NavBar.tsx b/components/NavBar.tsx index b36cdc8..bc91838 100644 --- a/components/NavBar.tsx +++ b/components/NavBar.tsx @@ -52,14 +52,14 @@ const HeadBar: FC = () => { className={cn( 'text-lg md:block', 'bg-white rounded-md', + 'dark:bg-rua-gray-800', 'absolute md:static', 'p-5 right-6 top-14', 'md:bg-transparent md:p-[unset]', 'md:right-[unset] md:top-[unset]', 'w-1/3 md:w-auto', - { - hidden: !showMenu, - } + 'md:dark:bg-transparent', + showMenu || 'hidden' )} >