Skip to content

Commit 2de03df

Browse files
committed
feat: add 'Documentation in Progress' banner at the top of the website
Signed-off-by: ItsNeil17 <neil@willofsteel.me>
1 parent 49f1303 commit 2de03df

3 files changed

Lines changed: 54 additions & 6 deletions

File tree

src/app/(home)/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default function HomePage() {
1616

1717
return (
1818
<div className="font-grotesk flex flex-col justify-center items-center min-h-[calc(100vh-4rem)] px-4 relative overflow-hidden">
19+
{/* Branch and Commit Info - Bottom Right */}
1920
<a
2021
href="https://github.com/HytaleModding/site"
2122
target="_blank"
@@ -106,6 +107,11 @@ export default function HomePage() {
106107
</a>
107108
</div>
108109
</div>
110+
111+
{/* Copyright Footer */}
112+
<div className="absolute bottom-4 left-4 z-10 text-xs text-slate-900 dark:text-slate-900">
113+
© {new Date().getFullYear()} Hytale Modding
114+
</div>
109115
</div>
110116
);
111117
}

src/app/docs/docs-banner.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
'use client';
2+
3+
import { useEffect, useState } from 'react';
4+
5+
export function DocsBanner() {
6+
const [gitInfo, setGitInfo] = useState({ branch: 'main', commit: 'abc1234' });
7+
8+
useEffect(() => {
9+
fetch('/git-info.json')
10+
.then(res => res.json())
11+
.then(data => setGitInfo(data))
12+
.catch(() => console.log('Git info not available'));
13+
}, []);
14+
15+
return (
16+
<div className="bg-slate-100 dark:bg-slate-900 border-b border-slate-200 dark:border-slate-800">
17+
<div className="max-w-screen-2xl mx-auto px-4 py-2.5">
18+
<div className="flex items-center justify-center gap-4 text-sm flex-wrap">
19+
<div className="flex items-center gap-2 text-slate-700 dark:text-slate-300">
20+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
21+
<path fillRule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clipRule="evenodd" />
22+
</svg>
23+
<span className="font-medium">Documentation In Progress</span>
24+
</div>
25+
<div className="flex items-center gap-1.5 text-xs font-mono text-slate-500 dark:text-slate-400">
26+
<svg className="w-3.5 h-3.5" fill="currentColor" viewBox="0 0 16 16">
27+
<path d="M11.5 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1 0-1h2.293L8.146 1.354a.5.5 0 0 1 .708-.708L11 2.793V.5a.5.5 0 0 1 .5-.5z"/>
28+
<path d="M5 2.5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 1 1 0v2A1.5 1.5 0 0 1 11.5 14h-9A1.5 1.5 0 0 1 1 12.5v-9A1.5 1.5 0 0 1 2.5 2h2a.5.5 0 0 1 .5.5z"/>
29+
</svg>
30+
<span>{gitInfo.branch}</span>
31+
<span className="text-slate-400 dark:text-slate-600">@</span>
32+
<span>{gitInfo.commit}</span>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
);
38+
}

src/app/docs/layout.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import { source } from '@/lib/source';
21
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
2+
import { source } from '@/lib/source';
33
import { baseOptions } from '@/lib/layout.shared';
4+
import { DocsBanner } from './docs-banner'; // Adjust path as needed
45

5-
export default function Layout({ children }: LayoutProps<'/docs'>) {
6+
export default function Layout({ children }: { children: React.ReactNode }) {
67
return (
7-
<DocsLayout tree={source.pageTree} {...baseOptions()}>
8-
{children}
9-
</DocsLayout>
8+
<div className="flex flex-col min-h-screen">
9+
<DocsBanner />
10+
<DocsLayout tree={source.pageTree} {...baseOptions()}>
11+
{children}
12+
</DocsLayout>
13+
</div>
1014
);
11-
}
15+
}

0 commit comments

Comments
 (0)