Skip to content

Commit b4a4823

Browse files
authored
Merge pull request #2 from openscan-explorer/fix/gh-pages-improvements
Fix GitHub Pages deployment issues and add SEO
2 parents 45bc62a + 5ed6b0f commit b4a4823

5 files changed

Lines changed: 66 additions & 2 deletions

File tree

app/not-found.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Link from "next/link"
2+
3+
export default function NotFound() {
4+
return (
5+
<div className="flex min-h-screen flex-col items-center justify-center gap-4 text-center">
6+
<h1 className="text-4xl font-bold">404</h1>
7+
<p className="text-muted-foreground">This page could not be found.</p>
8+
<Link
9+
href="/introduction"
10+
className="text-sm underline underline-offset-4 hover:text-foreground"
11+
>
12+
Go to docs
13+
</Link>
14+
</div>
15+
)
16+
}

app/page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
import { redirect } from "next/navigation"
1+
"use client"
2+
3+
import { useEffect } from "react"
4+
import { useRouter } from "next/navigation"
25

36
export default function Home() {
4-
redirect("/introduction")
7+
const router = useRouter()
8+
9+
useEffect(() => {
10+
router.replace("/introduction")
11+
}, [router])
12+
13+
return null
514
}

app/robots.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { MetadataRoute } from "next"
2+
3+
export default function robots(): MetadataRoute.Robots {
4+
return {
5+
rules: {
6+
userAgent: "*",
7+
allow: "/",
8+
},
9+
sitemap: "https://openscan-explorer.github.io/docs/sitemap.xml",
10+
}
11+
}

app/sitemap.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import type { MetadataRoute } from "next"
2+
3+
const BASE_URL = "https://openscan-explorer.github.io/docs"
4+
5+
const routes = [
6+
"/introduction",
7+
"/values",
8+
"/explorer",
9+
"/explorer/alpha-status",
10+
"/explorer/how-it-works",
11+
"/explorer/functionalities",
12+
"/explorer/settings",
13+
"/explorer/super-user",
14+
"/network-connectors",
15+
"/metadata",
16+
"/hardhat-plugin",
17+
"/skills",
18+
"/tutorials",
19+
"/subscriptions",
20+
"/contact",
21+
]
22+
23+
export default function sitemap(): MetadataRoute.Sitemap {
24+
return routes.map((route) => ({
25+
url: `${BASE_URL}${route}`,
26+
lastModified: new Date(),
27+
}))
28+
}

public/.nojekyll

Whitespace-only changes.

0 commit comments

Comments
 (0)