diff --git a/app/(home)/layout.tsx b/app/(home)/layout.tsx index 0928b44..8903f17 100644 --- a/app/(home)/layout.tsx +++ b/app/(home)/layout.tsx @@ -1,6 +1,21 @@ import { HomeLayout } from "fumadocs-ui/home-layout" import type { ReactNode } from "react" import { baseOptions } from "../layout.config" +import { Metadata } from "next" + +const SITE_URL = "https://docs.minima.global" + +export const metadata: Metadata = { + metadataBase: new URL(SITE_URL), + title: { + default: "Docs", + template: "%s | Docs", + }, + description: "The official documentation for Minima", + twitter: { + card: "summary_large_image", + }, +} export default function Layout({ children }: { children: ReactNode }) { return {children} diff --git a/app/(home)/page.tsx b/app/(home)/page.tsx index 1ef0840..8a7a70e 100644 --- a/app/(home)/page.tsx +++ b/app/(home)/page.tsx @@ -1,5 +1,11 @@ -import { DocsHomePage } from "@/components/homepage" - -export default function HomePage() { - return -} +import { DocsHomePage } from "@/components/homepage" +import { Metadata } from "next" + +export const metadata: Metadata = { + title: "Minima Docs", + description: "The official documentation for Minima", +} + +export default function HomePage() { + return +} diff --git a/app/docs/[[...slug]]/page.tsx b/app/docs/[[...slug]]/page.tsx index bc0b1c6..a10cb3e 100644 --- a/app/docs/[[...slug]]/page.tsx +++ b/app/docs/[[...slug]]/page.tsx @@ -3,10 +3,6 @@ import { DocsBody, DocsPage } from "fumadocs-ui/page" import type { Metadata } from "next" import { notFound } from "next/navigation" -import { getGithubLastEdit } from 'fumadocs-core/server'; - - - export default async function Page({ params, }: { @@ -20,7 +16,7 @@ export default async function Page({ const MDX = page.data.exports.default - const path = `/content/docs/${page.file.path}`; + const path = `/content/docs/${page.file.path}` /*const time = await getGithubLastEdit({ owner: "minima-global", @@ -28,7 +24,6 @@ export default async function Page({ path: path, });*/ - /*const lastUpdate = time?.toLocaleDateString("en-US", { month: "long", day: "numeric", @@ -36,11 +31,13 @@ export default async function Page({ });*/ return ( - {children} } diff --git a/app/global.css b/app/global.css index 901fa2d..355f67f 100644 --- a/app/global.css +++ b/app/global.css @@ -31,6 +31,17 @@ --learn-color: 161 40% 27%; --run-a-node-color: 215 100% 34%; --user-guides-color: 10 85% 55%; + --orange: 19, 100%, 51%; + --light-orange: 25, 100%, 59%; + --lighter-orange: 32, 100%, 64%; + + --grey: 240, 6%, 59%; + --grey-10: 240, 5%, 96%; + --grey-20: 240, 5%, 92%; + --grey-40: 240, 6%, 84%; + --grey-60: 240, 4%, 48%; + --grey-80: 240, 5%, 67%; + --grey-highlight: 240, 12%, 22%; } .dark { @@ -63,19 +74,18 @@ } .box { - border: 3px solid #615a5400; + border: 1px solid #615a5400; border-radius: 0.75rem; animation: 5s rotate linear infinite; background: linear-gradient(#fbfbfb, #fbfbfb) padding-box, - linear-gradient(var(--angle), #fbfbfb, #a5a3a1) border-box; - + linear-gradient(var(--angle), #fbfbfb, #9d9898) border-box; } .dark\:box:is(.dark *) { background: linear-gradient(#000000, #000000) padding-box, - linear-gradient(var(--angle), #070707, #504f4e) border-box; + linear-gradient(var(--angle), #070707, #9d9898) border-box; } @keyframes rotate { @@ -90,5 +100,10 @@ inherits: false; } - - +[data-theme-toggle] { + height: 38px; + display: flex; + align-items: center; + justify-content: center; + width: 65px; +} diff --git a/app/icon.ico b/app/icon.ico new file mode 100644 index 0000000..834f61e Binary files /dev/null and b/app/icon.ico differ diff --git a/app/layout.client.tsx b/app/layout.client.tsx index c42afa2..6e09be8 100644 --- a/app/layout.client.tsx +++ b/app/layout.client.tsx @@ -1,53 +1,65 @@ -"use client" -import { cva } from "class-variance-authority" -import Link from "next/link" -import { useParams } from "next/navigation" -import { ReactNode } from "react" -import { modes } from "./lib/modes" -import { cn } from "./lib/utils" - -const itemVariants = cva( - "rounded-md px-2 py-1 transition-colors hover:text-fd-accent-foreground", - { - variants: { - active: { - true: "bg-fd-accent text-fd-accent-foreground", - }, - }, - } -) - -export function Body({ - children, -}: { - children: ReactNode -}): React.ReactElement { - const mode = useMode() - - return ( - {children} - ) -} - -export function useMode(): string | undefined { - const { slug } = useParams() - return Array.isArray(slug) && slug.length > 0 ? slug[0] : undefined -} - -export function NavChildren(): React.ReactElement { - const mode = useMode() - - return ( -
- {modes.map((m) => ( - - {m.name} - - ))} -
- ) -} +"use client" +import { cva } from "class-variance-authority" +import Link from "next/link" +import { useParams, usePathname } from "next/navigation" +import { ReactNode, useEffect, useState } from "react" +import { modes } from "./lib/modes" +import { cn } from "./lib/utils" +import Footer from "@/components/footer" + +const itemVariants = cva( + "rounded-md px-3 py-1 transition-colors hover:text-fd-accent-foreground", + { + variants: { + active: { + true: "bg-fd-accent text-fd-accent-foreground", + }, + }, + } +) + +export function Body({ + children, +}: { + children: ReactNode +}): React.ReactElement { + const mode = useMode() + const isHome = usePathname() === "/" + const [mounted, setMounted] = useState(false) + + useEffect(() => { + setMounted(true) + }, []) + + return ( + + {children} + {mounted &&