2023-03-25 14:24:52 +00:00
|
|
|
/* eslint-disable @next/next/no-page-custom-font */
|
2023-03-19 14:13:00 +00:00
|
|
|
import "./styles/globals.scss";
|
|
|
|
import "./styles/markdown.scss";
|
2023-03-20 06:06:29 +00:00
|
|
|
import "./styles/prism.scss";
|
2023-03-25 14:24:52 +00:00
|
|
|
import process from "child_process";
|
2023-03-26 06:53:40 +00:00
|
|
|
import { ACCESS_CODES } from "./api/access";
|
|
|
|
|
2023-03-27 10:31:04 +00:00
|
|
|
let COMMIT_ID: string | undefined;
|
|
|
|
try {
|
|
|
|
COMMIT_ID = process
|
|
|
|
.execSync("git rev-parse --short HEAD")
|
|
|
|
.toString()
|
|
|
|
.trim();
|
|
|
|
} catch (e) {
|
|
|
|
console.error("No git or not from git repo.")
|
|
|
|
}
|
2023-03-07 15:23:54 +00:00
|
|
|
|
|
|
|
export const metadata = {
|
2023-03-09 17:01:40 +00:00
|
|
|
title: "ChatGPT Next Web",
|
2023-03-25 14:24:52 +00:00
|
|
|
description: "Your personal ChatGPT Chat Bot.",
|
2023-03-09 17:01:40 +00:00
|
|
|
};
|
2023-03-07 15:23:54 +00:00
|
|
|
|
2023-03-26 06:53:40 +00:00
|
|
|
function Meta() {
|
|
|
|
const metas = {
|
2023-03-27 10:31:04 +00:00
|
|
|
version: COMMIT_ID ?? "unknown",
|
2023-03-26 06:53:40 +00:00
|
|
|
access: ACCESS_CODES.size > 0 ? "enabled" : "disabled",
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{Object.entries(metas).map(([k, v]) => (
|
|
|
|
<meta name={k} content={v} key={k} />
|
|
|
|
))}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
2023-03-23 16:01:00 +00:00
|
|
|
|
2023-03-07 15:23:54 +00:00
|
|
|
export default function RootLayout({
|
|
|
|
children,
|
|
|
|
}: {
|
2023-03-09 17:01:40 +00:00
|
|
|
children: React.ReactNode;
|
2023-03-07 15:23:54 +00:00
|
|
|
}) {
|
|
|
|
return (
|
2023-03-15 17:24:03 +00:00
|
|
|
<html lang="en">
|
2023-03-20 06:06:29 +00:00
|
|
|
<head>
|
|
|
|
<meta
|
|
|
|
name="viewport"
|
|
|
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
|
|
|
/>
|
2023-03-26 06:53:40 +00:00
|
|
|
<Meta />
|
2023-03-20 06:06:29 +00:00
|
|
|
<link rel="manifest" href="/site.webmanifest"></link>
|
2023-03-23 16:01:00 +00:00
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com"></link>
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com"></link>
|
|
|
|
<link
|
|
|
|
href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;700;900&display=swap"
|
|
|
|
rel="stylesheet"
|
|
|
|
></link>
|
2023-03-20 06:06:29 +00:00
|
|
|
</head>
|
2023-03-07 15:23:54 +00:00
|
|
|
<body>{children}</body>
|
|
|
|
</html>
|
2023-03-09 17:01:40 +00:00
|
|
|
);
|
2023-03-07 15:23:54 +00:00
|
|
|
}
|