Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit b8e7bf5

Browse files
committed
demo for html extension not added to page redirect
1 parent 85291ce commit b8e7bf5

16 files changed

+5257
-2
lines changed

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

README.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
1-
# next-export-trailing-slash
2-
bug experiment to see if html is generated with trailing slash
1+
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).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
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.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

app/favicon.ico

25.3 KB
Binary file not shown.

app/globals.css

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
:root {
6+
--foreground-rgb: 0, 0, 0;
7+
--background-start-rgb: 214, 219, 220;
8+
--background-end-rgb: 255, 255, 255;
9+
}
10+
11+
@media (prefers-color-scheme: dark) {
12+
:root {
13+
--foreground-rgb: 255, 255, 255;
14+
--background-start-rgb: 0, 0, 0;
15+
--background-end-rgb: 0, 0, 0;
16+
}
17+
}
18+
19+
body {
20+
color: rgb(var(--foreground-rgb));
21+
background: linear-gradient(
22+
to bottom,
23+
transparent,
24+
rgb(var(--background-end-rgb))
25+
)
26+
rgb(var(--background-start-rgb));
27+
}
28+
29+
@layer utilities {
30+
.text-balance {
31+
text-wrap: balance;
32+
}
33+
}

app/hello/page.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// hello/index.tsx
2+
import { FC } from "react";
3+
4+
const Hello: FC = () => {
5+
return <h1>Hello</h1>;
6+
};
7+
8+
export default Hello;

app/layout.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { Metadata } from "next";
2+
import { Inter } from "next/font/google";
3+
import "./globals.css";
4+
5+
const inter = Inter({ subsets: ["latin"] });
6+
7+
export const metadata: Metadata = {
8+
title: "Create Next App",
9+
description: "Generated by create next app",
10+
};
11+
12+
export default function RootLayout({
13+
children,
14+
}: Readonly<{
15+
children: React.ReactNode;
16+
}>) {
17+
return (
18+
<html lang="en">
19+
<body className={inter.className}>{children}</body>
20+
</html>
21+
);
22+
}

app/page.tsx

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import Image from "next/image";
2+
import Link from "next/link";
3+
4+
export default function Home() {
5+
return (
6+
<main className="flex min-h-screen flex-col items-center justify-between p-24">
7+
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
8+
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
9+
Get started by editing&nbsp;
10+
<code className="font-mono font-bold">app/page.tsx</code>
11+
</p>
12+
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:size-auto lg:bg-none">
13+
<a
14+
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
15+
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
16+
target="_blank"
17+
rel="noopener noreferrer"
18+
>
19+
By{" "}
20+
<Image
21+
src="/vercel.svg"
22+
alt="Vercel Logo"
23+
className="dark:invert"
24+
width={100}
25+
height={24}
26+
priority
27+
/>
28+
</a>
29+
</div>
30+
</div>
31+
32+
<div className="relative z-[-1] flex place-items-center before:absolute before:h-[300px] before:w-full before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px]">
33+
<Image
34+
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
35+
src="/next.svg"
36+
alt="Next.js Logo"
37+
width={180}
38+
height={37}
39+
priority
40+
/>
41+
</div>
42+
43+
<div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
44+
<a
45+
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
46+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
47+
target="_blank"
48+
rel="noopener noreferrer"
49+
>
50+
<h2 className="mb-3 text-2xl font-semibold">
51+
Docs{" "}
52+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
53+
-&gt;
54+
</span>
55+
</h2>
56+
<p className="m-0 max-w-[30ch] text-sm opacity-50">
57+
Find in-depth information about Next.js features and API.
58+
</p>
59+
</a>
60+
61+
<a
62+
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
63+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
64+
target="_blank"
65+
rel="noopener noreferrer"
66+
>
67+
<h2 className="mb-3 text-2xl font-semibold">
68+
Learn{" "}
69+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
70+
-&gt;
71+
</span>
72+
</h2>
73+
<p className="m-0 max-w-[30ch] text-sm opacity-50">
74+
Learn about Next.js in an interactive course with&nbsp;quizzes!
75+
</p>
76+
</a>
77+
78+
<a
79+
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
80+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
81+
target="_blank"
82+
rel="noopener noreferrer"
83+
>
84+
<h2 className="mb-3 text-2xl font-semibold">
85+
Templates{" "}
86+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
87+
-&gt;
88+
</span>
89+
</h2>
90+
<p className="m-0 max-w-[30ch] text-sm opacity-50">
91+
Explore starter templates for Next.js.
92+
</p>
93+
</a>
94+
95+
<a
96+
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
97+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
98+
target="_blank"
99+
rel="noopener noreferrer"
100+
>
101+
<h2 className="mb-3 text-2xl font-semibold">
102+
Deploy{" "}
103+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
104+
-&gt;
105+
</span>
106+
</h2>
107+
<p className="m-0 max-w-[30ch] text-balance text-sm opacity-50">
108+
Instantly deploy your Next.js site to a shareable URL with Vercel.
109+
</p>
110+
</a>
111+
</div>
112+
113+
{/* Button to navigate to /hello */}
114+
<div className="mt-8">
115+
<Link href="/hello/">
116+
<button className="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors">
117+
Go to Hello Page
118+
</button>
119+
</Link>
120+
</div>
121+
</main>
122+
);
123+
}

next.config.mjs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** @type {import('next').NextConfig} */
2+
3+
const nextConfig = {
4+
distDir: "build",
5+
basePath:
6+
process.env.NODE_ENV === "production" ? "/frontend/build" : undefined,
7+
// assetPrefix: process.env.NODE_ENV === 'production' ? '/frontend/build' : undefined,
8+
images: {
9+
unoptimized: true,
10+
},
11+
output: "export",
12+
trailingSlash: true,
13+
skipTrailingSlashRedirect: true,
14+
};
15+
16+
export default nextConfig;

0 commit comments

Comments
 (0)