mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-30 04:59:25 +00:00
init: create project with settings
This commit is contained in:
11
src/libs/$path.ts
Normal file
11
src/libs/$path.ts
Normal 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
5
src/pages/_app.tsx
Normal 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
21
src/pages/_document.tsx
Normal 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
16
src/pages/index.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user