The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

add docs 404

Luna 264e60f4 53a9a524

+52 -8
+31 -6
app/docs/[...pathname]/layout.tsx
··· 1 1 import { Button, Divider } from "@nextui-org/react"; 2 2 import { Metadata } from "next"; 3 3 import Link from "next/link"; 4 - import { BsDiscord } from "react-icons/bs"; 5 - import { HiExternalLink } from "react-icons/hi"; 4 + import { BsDiscord, BsGithub } from "react-icons/bs"; 5 + import { HiExternalLink, HiUserAdd, HiViewGridAdd } from "react-icons/hi"; 6 6 7 7 import Footer from "@/components/footer"; 8 8 import metadata from "@/public/docs/meta.json"; ··· 16 16 export const generateMetadata = async ({ 17 17 params 18 18 }: Props): Promise<Metadata> => { 19 - const meta = metadata.pages.find((page) => page.file === `${params.pathname.join("/")}.md`); 19 + const meta = metadata.pages.find((page) => page.file === `${params.pathname.join("/").toLowerCase()}.md`); 20 20 21 21 const title = "Documentation"; 22 22 const url = getCanonicalUrl("docs", ...params.pathname); ··· 47 47 params, 48 48 children 49 49 }: Props) { 50 - const meta = metadata.pages.find((page) => page.file === `${params.pathname.join("/")}.md`); 50 + const meta = metadata.pages.find((page) => page.file === `${params.pathname.join("/").toLowerCase()}.md`); 51 51 52 52 return ( 53 53 <div className="w-full"> 54 54 55 - <div className="flex justify-between items-center"> 55 + <div className="md:flex justify-between items-center"> 56 56 <div> 57 57 <h1 className="text-2xl font-medium text-neutral-100"> 58 58 Documentation ··· 87 87 as={Link} 88 88 className="w-full !justify-start button-blurple mt-4" 89 89 href="/support" 90 + target="_blank" 90 91 startContent={<BsDiscord />} 91 92 endContent={<HiExternalLink />} 92 93 > ··· 98 99 as={Link} 99 100 className="w-full !justify-start font-medium" 100 101 href="/invite" 102 + target="_blank" 101 103 color="secondary" 102 - startContent={<BsDiscord />} 104 + startContent={<HiUserAdd />} 103 105 endContent={<HiExternalLink />} 104 106 > 105 107 Invite Wamellow 106 108 </Button> 107 109 </ol> 110 + <ol> 111 + <Button 112 + as={Link} 113 + className="w-full !justify-start" 114 + href="/profile" 115 + target="_blank" 116 + startContent={<HiViewGridAdd />} 117 + endContent={<HiExternalLink />} 118 + > 119 + Dashboard 120 + </Button> 121 + </ol> 122 + 123 + <ol> 124 + <Link 125 + className="flex items-center gap-1.5 hover:text-violet-400 duration-100" 126 + href={"https://github.com/Luna-devv/mellow-web/blob/master/public/docs"} 127 + target="_blank" 128 + > 129 + <BsGithub /> Contribute 130 + </Link> 131 + </ol> 108 132 </ul> 109 133 110 134 <Divider className="lg:hidden" /> 135 + 111 136 <div className="w-full lg:w-3/4"> 112 137 {children} 113 138 </div>
+21 -2
app/docs/[...pathname]/page.tsx
··· 1 1 import { Code } from "@nextui-org/react"; 2 2 import { readFile } from "fs/promises"; 3 + import Image from "next/image"; 3 4 4 5 import BeautifyMarkdown from "@/components/markdown"; 5 6 import Notice, { NoticeType } from "@/components/notice"; 7 + import { HomeButton, ScreenMessage, SupportButton } from "@/components/screen-message"; 6 8 import metadata from "@/public/docs/meta.json"; 9 + import SadWumpusPic from "@/public/sad-wumpus.gif"; 7 10 8 11 interface Props { 9 12 params: { pathname: string[] }; ··· 12 15 const PATH = `${process.cwd()}/public/docs` as const; 13 16 14 17 export default async function Home({ params }: Props) { 15 - const markdown = await readFile(`${PATH}/${params.pathname.join("/")}.md`, "utf-8"); 16 - const meta = metadata.pages.find((page) => page.file === `${params.pathname.join("/")}.md`); 18 + const markdown = await readFile(`${PATH}/${params.pathname.join("/").toLowerCase()}.md`, "utf-8").catch(() => null); 19 + const meta = metadata.pages.find((page) => page.file === `${params.pathname.join("/").toLowerCase()}.md`); 20 + 21 + if (!markdown || !meta) { 22 + return ( 23 + <ScreenMessage 24 + top="0rem" 25 + title="Sadly, this page can not be found.." 26 + description="Seems like you got a little lost here? Here's wumpus for now!" 27 + buttons={<> 28 + <HomeButton /> 29 + <SupportButton /> 30 + </>} 31 + > 32 + <Image src={SadWumpusPic} alt="" height={141} width={124} /> 33 + </ScreenMessage> 34 + ); 35 + } 17 36 18 37 return ( 19 38 <div>