fixes and changes

pull/2/head
Elias Almqvist 1 month ago
parent d5030661dd
commit b59ded9c0d
No known key found for this signature in database
GPG Key ID: E31A99CE3E75A158
  1. 8
      src/app/[...dir]/page.tsx
  2. 0
      src/app/essays/page.tsx
  3. 3
      src/app/layout.tsx
  4. 10
      src/components/layout/header.tsx
  5. 8
      src/components/layout/nav.tsx

@ -22,13 +22,13 @@ async function getPost(slug: string[]): Promise<Post | null> {
const postName = slug[1];
const postsDirectory = path.join(process.cwd(), 'content/essays');
try {
const fullPath = path.join(postsDirectory, `${postName}.mdx`);
const fileContents = await fs.readFile(fullPath, 'utf8');
const { data, content } = matter(fileContents);
return {
title: data.title,
createdAt: data.createdAt,
@ -58,7 +58,7 @@ const Page = async ({ params }: { params: { dir: string[] } }) => {
</time>
)}
</div>
<MDXRemote
<MDXRemote
source={post.content}
options={{
mdxOptions: {

@ -70,8 +70,7 @@ export default function RootLayout({
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
defaultTheme="light"
disableTransitionOnChange
>
<Layout>{children}</Layout>

@ -15,16 +15,16 @@ const Header = () => (
href="/"
className="flex flex-row items-center gap-x-2 hover:opacity-80 transition-opacity"
>
<Logo className="w-8 h-auto" />
<h1 className="text-xl font-bold">collected sayings of an insane sane person</h1>
</Link>
</div>
<div className="flex flex-row items-center space-x-2">
<ThemeButton className="w-4 h-4 hidden sm:block" />
<NavCommand />
<div className="flex flex-row items-center space-x-8">
{/* <ThemeButton className="w-4 h-4 hidden sm:block" /> */}
<ExternalNav className="hidden sm:flex flex-row space-x-1" />
<NavCommand />
</div>
</div>
<Separator />
{/* <Separator /> */}
</header>
);
export default Header;

@ -69,16 +69,16 @@ const NavCommand: React.FC<NavCommandProps> = ({ className, ...props }) => {
</CommandItem>
<CommandItem
onSelect={action(() => {
router.push("/posts");
router.push("/essays");
})}
>
<GalleryHorizontalEnd className="mr-2 w-4 h-4" />
<span>Posts</span>
<span>Essays</span>
<CommandShortcut>P</CommandShortcut>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Appearance">
{/* <CommandGroup heading="Appearance">
<CommandItem
onSelect={action(() => {
setTheme(theme === "light" ? "dark" : "light");
@ -90,7 +90,7 @@ const NavCommand: React.FC<NavCommandProps> = ({ className, ...props }) => {
</span>
<CommandShortcut>L</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandGroup> */}
<CommandSeparator />
<CommandGroup heading="External links">
{NavLinks.map((link) => (

Loading…
Cancel
Save