forked from InvolutionHell/involutionhell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.tsx
More file actions
42 lines (40 loc) · 1.33 KB
/
page.tsx
File metadata and controls
42 lines (40 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import Link from "next/link";
import { source } from "@/lib/source";
import HoverCard from "@/app/components/HoverCard";
export default function DocsIndex() {
const pages = source
.getPages()
.sort((a, b) => (a.data.title ?? "").localeCompare(b.data.title ?? ""));
return (
<main style={{ maxWidth: 800, margin: "40px auto", padding: 16 }}>
<h1 style={{ fontSize: 28, fontWeight: 700, marginBottom: 16 }}>Docs</h1>
<ul style={{ display: "grid", gap: 12 }}>
{pages.map((d) => (
<li key={d.slugs.join("/")}>
<HoverCard
hoverType="scale"
className="border border-gray-200 rounded-lg p-4 cursor-pointer bg-white dark:bg-gray-800 dark:border-gray-700"
>
<Link
href={`/docs/${d.slugs.join("/")}`}
className="block w-full h-full"
style={{
fontWeight: 600,
textDecoration: "none",
color: "inherit",
}}
>
{d.data.title}
{d.data.description && (
<p style={{ opacity: 0.8, marginTop: 8 }}>
{d.data.description}
</p>
)}
</Link>
</HoverCard>
</li>
))}
</ul>
</main>
);
}