commit 7e3030bd015351234758f3b4fe6dabb066ecade4 Author: DefectingCat Date: Sun Mar 20 19:08:06 2022 +0800 Init diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d093c3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo diff --git a/README.md b/README.md new file mode 100644 index 0000000..c87e042 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/components/NavBar.tsx b/components/NavBar.tsx new file mode 100644 index 0000000..9686da3 --- /dev/null +++ b/components/NavBar.tsx @@ -0,0 +1,16 @@ +import Link from 'next/link'; +import { FC } from 'react'; + +const HeadBar: FC = () => { + return ( + <> +
+ RUARUARUA + +
+
+ + ); +}; + +export default HeadBar; diff --git a/layouts/MainLayout.tsx b/layouts/MainLayout.tsx new file mode 100644 index 0000000..0d2dbe5 --- /dev/null +++ b/layouts/MainLayout.tsx @@ -0,0 +1,14 @@ +import { FC } from 'react'; +import HeadBar from 'components/NavBar'; + +const MainLayout: FC = ({ children }) => { + return ( + <> + + +
{children}
+ + ); +}; + +export default MainLayout; diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 0000000..4f11a03 --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..e96d36c --- /dev/null +++ b/next.config.js @@ -0,0 +1,16 @@ +const withMDX = require('@next/mdx')({ + extension: /\.mdx?$/, + options: { + remarkPlugins: [], + rehypePlugins: [], + // providerImportSource: '@mdx-js/react', + }, +}); + +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: true, + pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], +}; + +module.exports = withMDX(nextConfig); diff --git a/package.json b/package.json new file mode 100644 index 0000000..aeb0e5d --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "blog-v3", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@mdx-js/loader": "^2.1.0", + "@next/mdx": "^12.1.0", + "classnames": "^2.3.1", + "next": "12.1.0", + "react": "17.0.2", + "react-dom": "17.0.2" + }, + "devDependencies": { + "@types/node": "17.0.21", + "@types/react": "17.0.41", + "autoprefixer": "^10.4.4", + "eslint": "8.11.0", + "eslint-config-next": "12.1.0", + "postcss": "^8.4.12", + "tailwindcss": "^3.0.23", + "typescript": "4.6.2" + } +} diff --git a/pages/_app.tsx b/pages/_app.tsx new file mode 100644 index 0000000..4b7198f --- /dev/null +++ b/pages/_app.tsx @@ -0,0 +1,48 @@ +import 'styles/globals.css'; +import type { AppProps } from 'next/app'; +import { NextPage } from 'next'; +import { ReactElement, ReactNode } from 'react'; +import Head from 'next/head'; + +type NextPageWithLayout = NextPage & { + getLayout?: (page: ReactElement) => ReactNode; +}; +type AppPropsWithLayout = AppProps & { + Component: NextPageWithLayout; +}; + +function MyApp({ Component, pageProps }: AppPropsWithLayout) { + const getLayout = Component.getLayout ?? ((page) => page); + + return ( + <> + + + + + +