|
| 1 | +import { Footer, Layout, Navbar } from "nextra-theme-docs"; |
| 2 | +import { Head } from "nextra/components"; |
| 3 | +import { getPageMap } from "nextra/page-map"; |
| 4 | +import localFont from "next/font/local"; |
| 5 | +import "nextra-theme-docs/style.css"; |
| 6 | +import "./logo.css"; |
| 7 | +import "./fonts.css"; |
| 8 | + |
| 9 | +const calSans = localFont({ |
| 10 | + src: "../fonts/CalSans-Regular.woff2", |
| 11 | + variable: "--font-cal", |
| 12 | + display: "swap", |
| 13 | + weight: "400", |
| 14 | +}); |
| 15 | + |
| 16 | +const calSansUI = localFont({ |
| 17 | + src: [ |
| 18 | + { path: "../fonts/CalSansUI-UILight.woff2", weight: "300" }, |
| 19 | + { path: "../fonts/CalSansUI-UIRegular.woff2", weight: "400" }, |
| 20 | + { path: "../fonts/CalSansUI-UIMedium.woff2", weight: "500" }, |
| 21 | + { path: "../fonts/CalSansUI-UISemiBold.woff2", weight: "600" }, |
| 22 | + { path: "../fonts/CalSansUI-UIBold.woff2", weight: "700" }, |
| 23 | + ], |
| 24 | + variable: "--font-cal-ui", |
| 25 | + display: "swap", |
| 26 | +}); |
| 27 | + |
| 28 | +const navbar: React.ReactElement = ( |
| 29 | + <Navbar |
| 30 | + logo={ |
| 31 | + <> |
| 32 | + <img |
| 33 | + src="/cal-docs-logo.svg" |
| 34 | + alt="Cal.diy Docs" |
| 35 | + height={26} |
| 36 | + className="logo-light" |
| 37 | + style={{ height: 26 }} |
| 38 | + /> |
| 39 | + <img |
| 40 | + src="/cal-docs-logo-white.svg" |
| 41 | + alt="Cal.diy Docs" |
| 42 | + height={26} |
| 43 | + className="logo-dark" |
| 44 | + style={{ height: 26 }} |
| 45 | + /> |
| 46 | + </> |
| 47 | + } |
| 48 | + /> |
| 49 | +); |
| 50 | + |
| 51 | +const footer: React.ReactElement = ( |
| 52 | + <Footer> |
| 53 | + <small> |
| 54 | + Cal.diy is the open source community edition of Cal.com. Cal.com® and Cal® |
| 55 | + are a registered trademark by Cal.com, Inc. All rights reserved. |
| 56 | + </small> |
| 57 | + </Footer> |
| 58 | +); |
| 59 | + |
| 60 | +export const metadata: { title: string; description: string } = { |
| 61 | + title: "Cal.com Docs", |
| 62 | + description: "Cal.com self-hosting documentation", |
| 63 | +}; |
| 64 | + |
| 65 | +export default async function RootLayout({ |
| 66 | + children, |
| 67 | +}: { |
| 68 | + children: React.ReactNode; |
| 69 | +}) { |
| 70 | + return ( |
| 71 | + <html |
| 72 | + lang="en" |
| 73 | + dir="ltr" |
| 74 | + suppressHydrationWarning |
| 75 | + className={`${calSans.variable} ${calSansUI.variable}`} |
| 76 | + > |
| 77 | + <Head /> |
| 78 | + <body> |
| 79 | + <Layout |
| 80 | + navbar={navbar} |
| 81 | + pageMap={await getPageMap()} |
| 82 | + docsRepositoryBase="https://github.com/calcom/cal.com/tree/main/apps/docs" |
| 83 | + footer={footer} |
| 84 | + > |
| 85 | + {children} |
| 86 | + </Layout> |
| 87 | + </body> |
| 88 | + </html> |
| 89 | + ); |
| 90 | +} |
0 commit comments