Skip to content

Commit ebec501

Browse files
committed
refactor: modularized components
1 parent 654cbf8 commit ebec501

File tree

15 files changed

+81
-71
lines changed

15 files changed

+81
-71
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
id: deployment
5555
uses: actions/upload-pages-artifact@v3
5656
with:
57-
path: apps/docs/out/
57+
path: apps/docs/dist/
5858

5959
# Deploy to github pages
6060
# ref: https://github.com/actions/deploy-pages

apps/docs/app/favicon.ico

17.3 KB
Binary file not shown.

apps/docs/app/layout.tsx

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
1-
import { Footer, Layout, Navbar } from "nextra-theme-docs";
1+
import { Layout } from "nextra-theme-docs";
22
import { Head } from "nextra/components";
33
import { getPageMap } from "nextra/page-map";
44
import type { Metadata } from "next";
5-
import "nextra-theme-docs/style.css";
5+
import { Navbar } from "@/components/navbar";
6+
import { Footer } from "@/components/footer";
7+
import { METADATA } from "@/lib/constants";
8+
import "@/app/globals.css";
69

7-
export const metadata: Metadata = {};
8-
9-
const navbar = <Navbar logo={<b>Nextra</b>} />;
10-
const footer = <Footer>MIT {new Date().getFullYear()} © Nextra.</Footer>;
10+
export const metadata: Metadata = {
11+
title: METADATA.title,
12+
description: METADATA.description,
13+
};
1114

1215
export default async function RootLayout({
1316
children,
1417
}: {
1518
children: React.ReactNode;
1619
}) {
1720
return (
18-
<html
19-
// Not required, but good for SEO
20-
lang="en"
21-
// Required to be set
22-
dir="ltr"
23-
// Suggested by `next-themes` package https://github.com/pacocoursey/next-themes#with-app
24-
suppressHydrationWarning
25-
>
21+
<html lang="en" dir="ltr" suppressHydrationWarning>
2622
<Head></Head>
2723
<body>
2824
<Layout
29-
navbar={navbar}
25+
navbar={Navbar}
3026
pageMap={await getPageMap()}
31-
docsRepositoryBase="https://github.com/nedhmn/ygo-ruling-ai-chatbot/apps/docs"
32-
footer={footer}
27+
docsRepositoryBase={METADATA.docsRepositoryBase}
28+
editLink={false}
3329
>
3430
{children}
3531
</Layout>

apps/docs/app/not-found.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { NotFoundPage } from "nextra-theme-docs";
2+
3+
export default function NotFound() {
4+
return (
5+
<NotFoundPage content="Submit an issue" labels="broken-link">
6+
<h1>The page is not found</h1>
7+
</NotFoundPage>
8+
);
9+
}

apps/docs/components/footer.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Footer as NextraFooter } from "nextra-theme-docs";
2+
3+
export const Footer = (
4+
<NextraFooter>MIT {new Date().getFullYear()} © nedhmn.</NextraFooter>
5+
);

apps/docs/components/logo.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from "react";
2+
import VercelIconDark from "@/public/vercel-icon-dark.svg";
3+
import VercelIconLight from "@/public/vercel-icon-light.svg";
4+
import Image from "next/image";
5+
6+
export const Logo = () => {
7+
return (
8+
<div className="flex items-center">
9+
<Image
10+
src={VercelIconDark}
11+
className="mr-2 dark:block hidden"
12+
alt="Vercel icon"
13+
width={24}
14+
height={24}
15+
/>
16+
<Image
17+
src={VercelIconLight}
18+
className="mr-2 dark:hidden"
19+
alt="Vercel icon"
20+
width={24}
21+
height={24}
22+
/>
23+
<span className="font-semibold">Yu-GI-Oh! Ruling AI Chatbot</span>
24+
</div>
25+
);
26+
};

apps/docs/components/navbar.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Navbar as NextraNavbar } from "nextra-theme-docs";
2+
import { Logo } from "@/components/logo";
3+
import { METADATA } from "@/lib/constants";
4+
5+
export const Navbar = (
6+
<NextraNavbar logo={<Logo />} projectLink={METADATA.githubLink} />
7+
);

apps/docs/content/index.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
## Welcome Nextra
1+
---
2+
title: Introduction
3+
---
24

3-
Welcome to the Nextra application!
5+
## Welcome
6+
7+
Welcome to Yu-Gi-Oh! Ruling AI Chatbot!

apps/docs/lib/constants.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export const METADATA = {
2+
title: "Yu-Gi-Oh! Ruling's Chat",
3+
description:
4+
"AI chatbot for Yu-Gi-Oh! Goat Format rulings, built with Next.js and powered by RAG.",
5+
githubLink: "https://github.com/nedhmn/ygo-ruling-ai-chatbot",
6+
docsRepositoryBase:
7+
"https://github.com/nedhmn/ygo-ruling-ai-chatbot/apps/docs",
8+
};

apps/docs/public/circles.svg

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)