init: create project with settings

This commit is contained in:
rusconn
2022-03-21 03:02:59 +00:00
commit d1e5c9e7f6
22 changed files with 2367 additions and 0 deletions

11
src/libs/$path.ts Normal file
View File

@@ -0,0 +1,11 @@
export const pagesPath = {
$url: (url?: { hash?: string }) => ({ pathname: "/" as const, hash: url?.hash }),
};
export type PagesPath = typeof pagesPath;
export const staticPath = {
favicon_ico: "/favicon.ico",
} as const;
export type StaticPath = typeof staticPath;

5
src/pages/_app.tsx Normal file
View File

@@ -0,0 +1,5 @@
import type { AppProps } from "next/app";
const MyApp = ({ Component, pageProps }: AppProps) => <Component {...pageProps} />;
export default MyApp;

21
src/pages/_document.tsx Normal file
View File

@@ -0,0 +1,21 @@
import Document, { DocumentContext, Html, Head, Main, NextScript } from "next/document";
const MyDocument = class extends Document {
static async getInitialProps(ctx: DocumentContext) {
return Document.getInitialProps(ctx);
}
render() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
};
export default MyDocument;

16
src/pages/index.tsx Normal file
View File

@@ -0,0 +1,16 @@
import type { NextPage } from "next";
import Head from "next/head";
import { staticPath } from "@/libs/$path";
const Page: NextPage = () => (
<>
<Head>
<title>DevToysWeb</title>
<link rel="icon" href={staticPath.favicon_ico} />
</Head>
<p>hello</p>
</>
);
export default Page;