diff --git a/documentation/mojang/endpoint-status.md b/documentation/mojang/endpoint-status.md index 5ac5935..393a7e2 100644 --- a/documentation/mojang/endpoint-status.md +++ b/documentation/mojang/endpoint-status.md @@ -1,9 +1,9 @@ --- -title: Mojang - Endpoint Status +title: Mojang Endpoint Status summary: Get the status of the Mojang APIs. --- -# Mojang - Endpoint Status +# Overview The Mojang endpoint status endpoint allows you to get the status of the Mojang APIs. diff --git a/documentation/player/player-lookup.md b/documentation/player/player-lookup.md index 28fefa7..bf3202a 100644 --- a/documentation/player/player-lookup.md +++ b/documentation/player/player-lookup.md @@ -3,7 +3,7 @@ title: Player Lookup summary: Get information about a player. --- -# Player Lookup +# Overview The player lookup endpoint allows you to get information about a player. This includes their UUID, username, and any other information that is available. diff --git a/documentation/player/skin-parts.md b/documentation/player/skin-parts.md index 567bbd0..9606c43 100644 --- a/documentation/player/skin-parts.md +++ b/documentation/player/skin-parts.md @@ -1,9 +1,9 @@ --- -title: Player - Skin Parts +title: Player Skin Parts summary: Get a specific part of a player's skin. --- -# Player - Skin Parts +# Overview The player skin parts endpoint allows you to get a specific part of a player's skin. diff --git a/documentation/player/username-to-uuid.md b/documentation/player/username-to-uuid.md index 2292826..f8fbb59 100644 --- a/documentation/player/username-to-uuid.md +++ b/documentation/player/username-to-uuid.md @@ -1,9 +1,9 @@ --- -title: Player - Username to UUID +title: Player Username to UUID summary: Get a player's UUID from their username. --- -# Player - Username to UUID +# Overview The player username to UUID endpoint allows you to get a player's UUID from their username. diff --git a/documentation/server/blocked.md b/documentation/server/blocked.md index 8330a87..bc8a138 100644 --- a/documentation/server/blocked.md +++ b/documentation/server/blocked.md @@ -1,9 +1,9 @@ --- -title: Server - Blocked Status +title: Server Blocked Status summary: Get the Mojang blocked status of a Minecraft server. --- -# Server - Blocked Status +# Overview The server blocked status endpoint allows you to get the Mojang blocked status of a Minecraft server. diff --git a/documentation/server/favicon.md b/documentation/server/favicon.md index 15a268c..1f5d5b9 100644 --- a/documentation/server/favicon.md +++ b/documentation/server/favicon.md @@ -1,9 +1,9 @@ --- -title: Server - Favicon +title: Server Favicon summary: Get the favicon of a Minecraft server. --- -# Server - Favicon +# Overview The server favicon endpoint allows you to get the favicon of a Minecraft server. diff --git a/documentation/server/preview.md b/documentation/server/preview.md index b40c78e..d6cecec 100644 --- a/documentation/server/preview.md +++ b/documentation/server/preview.md @@ -1,9 +1,9 @@ --- -title: Server - Preview +title: Server Preview summary: Get the server list preview of a Minecraft server. --- -# Server - Preview +# Overview The server preview endpoint allows you to get the server list preview of a Minecraft server. diff --git a/documentation/server/server-lookup.md b/documentation/server/server-lookup.md index fa87b08..e1c359c 100644 --- a/documentation/server/server-lookup.md +++ b/documentation/server/server-lookup.md @@ -3,7 +3,7 @@ title: Server Lookup summary: Get information about a server. --- -# Server Lookup +# Overview The server lookup endpoint allows you to get information about a server. This includes the server's IP address, port, and any other information that is available. diff --git a/src/app/(pages)/docs/[[...slug]]/page.tsx b/src/app/(pages)/docs/[[...slug]]/page.tsx index 57e5862..37c9b6f 100644 --- a/src/app/(pages)/docs/[[...slug]]/page.tsx +++ b/src/app/(pages)/docs/[[...slug]]/page.tsx @@ -3,16 +3,9 @@ import { Metadata } from "next"; import { generateEmbed } from "@/app/common/embed"; import { Title } from "@/app/components/title"; import { DocsContentMetadata, getDocContent, getDocsContent } from "@/app/common/documentation"; -import { - Breadcrumb, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbSeparator, -} from "@/app/components/ui/breadcrumb"; -import { capitalizeFirstLetter } from "@/app/common/string-utils"; import { notFound } from "next/navigation"; import { GithubLink } from "@/app/components/docs/github-link"; +import { DocsBreadcrumb } from "@/app/components/docs/breadcrumb"; type DocumentationPageParams = { params: { @@ -56,36 +49,11 @@ export default function Page({ params: { slug } }: DocumentationPageParams) { return notFound(); } - const slugParts: string[] = page.slug.split("/"); - const isHome: boolean = slugParts.length == 1; - return (
{/* The breadcrumb for the documentation page */} - - - - Home - - {!isHome && - slugParts.map((slug, index, array) => { - const path: string = array.slice(0, index + 1).join("/"); - const name: string = slug.includes("-") - ? slug.split("-").map(capitalizeFirstLetter).join(" ") - : capitalizeFirstLetter(slug); - - return ( -
- - - {capitalizeFirstLetter(name)} - -
- ); - })} -
-
+ {/* The Git link for the documentation page */}
diff --git a/src/app/components/docs/breadcrumb.tsx b/src/app/components/docs/breadcrumb.tsx new file mode 100644 index 0000000..0f1c186 --- /dev/null +++ b/src/app/components/docs/breadcrumb.tsx @@ -0,0 +1,48 @@ +import { ReactElement } from "react"; +import { + Breadcrumb, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbSeparator, +} from "@/app/components/ui/breadcrumb"; +import { capitalizeFirstLetter } from "@/app/common/string-utils"; +import { DocsContentMetadata } from "@/app/common/documentation"; + +type DocsBreadcrumbProps = { + /** + * The page to render the breadcrumb for. + */ + page: DocsContentMetadata; +}; + +export function DocsBreadcrumb({ page }: DocsBreadcrumbProps): ReactElement { + const slugParts: string[] = page.slug.split("/"); + const isHome: boolean = slugParts.length == 1; + + return ( + + + + Home + + {!isHome && + slugParts.map((slug, index, array) => { + const path: string = array.slice(0, index + 1).join("/"); + const name: string = slug.includes("-") + ? slug.split("-").map(capitalizeFirstLetter).join(" ") + : capitalizeFirstLetter(slug); + + return ( +
+ + + {capitalizeFirstLetter(name)} + +
+ ); + })} +
+
+ ); +} diff --git a/src/app/components/ui/dialog.tsx b/src/app/components/ui/dialog.tsx index 347ab98..d331157 100644 --- a/src/app/components/ui/dialog.tsx +++ b/src/app/components/ui/dialog.tsx @@ -38,7 +38,7 @@ const DialogContent = React.forwardRef< void }) {