Skip to content

Commit 3c4e81c

Browse files
Flou21Ekwav
andauthored
add a wiki (#1387)
* add a wiki * correct ai wiki text * Extend wiki text fix #1388 * remove unused function --------- Co-authored-by: Äkwav <[email protected]>
1 parent 2ffb0eb commit 3c4e81c

17 files changed

Lines changed: 2930 additions & 61 deletions

app/mod/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ export default function Mod() {
1616
)
1717
}
1818

19-
export const metadata = getHeadMetadata('Mod', 'The Coflnet Minecraft Mod')
19+
export const metadata = getHeadMetadata('Mod', 'The SkyCofl Minecraft Mod')

app/wiki/[slug]/page.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { Container } from 'react-bootstrap'
2+
import { getAllWikiPages, getWikiPageBySlug } from '../../../utils/WikiUtils'
3+
import { getHeadMetadata } from '../../../utils/SSRUtils'
4+
import WikiContent from '../../../components/Wiki/WikiContent'
5+
import { notFound } from 'next/navigation'
6+
7+
interface Props {
8+
params: Promise<{ slug: string }>
9+
}
10+
11+
export default async function WikiPage(props: Props) {
12+
const params = await props.params
13+
const [page, allPages] = await Promise.all([
14+
getWikiPageBySlug(params.slug),
15+
getAllWikiPages()
16+
])
17+
18+
if (!page) {
19+
notFound()
20+
}
21+
22+
return (
23+
<Container>
24+
<WikiContent page={page} allPages={allPages} />
25+
</Container>
26+
)
27+
}
28+
29+
export async function generateStaticParams() {
30+
const pages = await getAllWikiPages()
31+
return pages.map(page => ({
32+
slug: page.slug
33+
}))
34+
}
35+
36+
export async function generateMetadata(props: Props) {
37+
const params = await props.params
38+
const page = await getWikiPageBySlug(params.slug)
39+
40+
if (!page) {
41+
return {}
42+
}
43+
44+
return getHeadMetadata(
45+
`${page.title} | Wiki`,
46+
page.description || `Learn about ${page.title} on SkyCofl`,
47+
undefined,
48+
['wiki', 'documentation', page.title.toLowerCase()],
49+
`${page.title} | SkyCofl Wiki`
50+
)
51+
}

app/wiki/page.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Container } from 'react-bootstrap'
2+
import { getAllWikiPages } from '../../utils/WikiUtils'
3+
import { getHeadMetadata } from '../../utils/SSRUtils'
4+
import WikiContent from '../../components/Wiki/WikiContent'
5+
import { notFound } from 'next/navigation'
6+
7+
export default async function WikiHomePage() {
8+
const pages = await getAllWikiPages()
9+
const homePage = pages.find(page => page.slug === 'index')
10+
11+
if (!homePage) {
12+
notFound()
13+
}
14+
15+
return (
16+
<Container>
17+
<WikiContent page={homePage} allPages={pages} />
18+
</Container>
19+
)
20+
}
21+
22+
export const metadata = getHeadMetadata(
23+
'Wiki | SkyCofl Documentation',
24+
'Comprehensive guide to SkyCofl features and Hypixel SkyBlock tools',
25+
undefined,
26+
['wiki', 'documentation', 'guide', 'tutorial']
27+
)

components/NavBar/NavBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ function NavBar(props: Props) {
182182
<MenuItem className={styles.menuItem} component={<Link href={'/about'} />} icon={<PolicyIcon />}>
183183
Links / Legal
184184
</MenuItem>
185-
<MenuItem className={styles.menuItem} component={<Link href={'/feedback'} />} icon={<ChatIcon />}>
186-
Feedback
185+
<MenuItem className={styles.menuItem} component={<Link href={'/wiki'} />} icon={<ChatIcon />}>
186+
Wiki
187187
</MenuItem>
188188
<MenuItem
189189
className={styles.menuItem}

components/Ref/Ref.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function Ref() {
7676
<hr />
7777
</div>
7878
) : null}
79-
<p>Share your referral link with people which might find Coflnet useful.</p>
79+
<p>Share your referral link with people which might find SkyCofl useful.</p>
8080
<p>Rewards per invited person:</p>
8181
<ul>
8282
<li>

0 commit comments

Comments
 (0)