Skip to content

Commit e38ee37

Browse files
authored
Updating template (#1)
* Updating dependencies and fixing next.config.js * Adding _document to pages * Adding example basic component * Added basic OpenGraph properties
1 parent 28a29e8 commit e38ee37

File tree

9 files changed

+2103
-24
lines changed

9 files changed

+2103
-24
lines changed

.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_BASE_URL=http://127.0.0.1:3000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.title {
2+
@apply m-0;
3+
4+
@apply font-bold;
5+
@apply text-7xl text-center;
6+
}

components/HelloWorld/HelloWorld.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import styles from './HelloWorld.module.scss';
2+
3+
const HelloWorld = () => {
4+
return (
5+
<h1 className={styles.title}>
6+
Hello world!
7+
</h1>
8+
);
9+
};
10+
11+
export default HelloWorld;

next.config.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
const nextConfig = {
33
reactStrictMode: true,
44
swcMinify: true,
5-
experimental: {
6-
images: {
7-
unoptimized: true,
8-
},
5+
images: {
6+
unoptimized: true,
97
},
108
}
119

package.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,25 @@
55
"scripts": {
66
"dev": "next dev",
77
"build": "next build",
8+
"export": "yarn && yarn build && yarn next export",
89
"start": "next start",
910
"lint": "next lint"
1011
},
1112
"dependencies": {
12-
"next": "12.2.3",
13+
"next": "12.3.1",
1314
"react": "18.2.0",
1415
"react-dom": "18.2.0"
1516
},
1617
"devDependencies": {
17-
"@types/node": "18.6.2",
18-
"@types/react": "18.0.15",
18+
"@types/node": "18.8.5",
19+
"@types/react": "18.0.21",
1920
"@types/react-dom": "18.0.6",
20-
"autoprefixer": "^10.4.8",
21-
"eslint": "8.20.0",
22-
"eslint-config-next": "12.2.3",
23-
"postcss": "^8.4.14",
24-
"sass": "^1.54.0",
25-
"tailwindcss": "^3.1.7",
26-
"typescript": "4.7.4"
21+
"autoprefixer": "^10.4.12",
22+
"eslint": "8.25.0",
23+
"eslint-config-next": "12.3.1",
24+
"postcss": "^8.4.18",
25+
"sass": "^1.55.0",
26+
"tailwindcss": "^3.1.8",
27+
"typescript": "4.8.4"
2728
}
2829
}

pages/_document.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Html, Head, Main, NextScript } from 'next/document';
2+
3+
export default function Document() {
4+
return (
5+
<Html lang="en">
6+
<Head />
7+
8+
<body>
9+
<Main />
10+
<NextScript />
11+
</body>
12+
</Html>
13+
);
14+
}

pages/index.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { NextPage } from 'next'
22
import Head from 'next/head'
3+
import HelloWorld from '../components/HelloWorld/HelloWorld'
34
import styles from '../styles/Home.module.scss'
45

56
const Home: NextPage = () => {
@@ -8,13 +9,17 @@ const Home: NextPage = () => {
89
<Head>
910
<title>Create Next App</title>
1011
<meta name="description" content="Generated by create next app" />
12+
13+
<meta property="og:title" content="Next Website"></meta>
14+
<meta property="og:type" content="website"></meta>
15+
<meta property="og:image" content="#"></meta>
16+
<meta property="og:url" content={`${process.env.NEXT_PUBLIC_BASE_URL}/`}></meta>
17+
1118
<link rel="icon" href="/favicon.ico" />
1219
</Head>
1320

1421
<main className={styles.main}>
15-
<h1 className={styles.title}>
16-
Hello world!
17-
</h1>
22+
<HelloWorld />
1823
</main>
1924
</div>
2025
)

styles/Home.module.scss

-7
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,3 @@
77
@apply px-16 py-0;
88
@apply min-h-screen;
99
}
10-
11-
.title {
12-
@apply m-0;
13-
14-
@apply font-bold;
15-
@apply text-7xl text-center;
16-
}

0 commit comments

Comments
 (0)