mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
73 lines
2.0 KiB
TypeScript
73 lines
2.0 KiB
TypeScript
import React from 'react';
|
|
import { DocsThemeConfig, useConfig } from 'nextra-theme-docs';
|
|
import { useRouter } from 'next/router';
|
|
import Search from '@components/Search';
|
|
|
|
function useHead() {
|
|
const { asPath } = useRouter();
|
|
const { frontMatter, title } = useConfig();
|
|
const url = `https://overextended.dev${asPath}`;
|
|
const description = frontMatter.description || "Documentation for Overextended's resources for FiveM/RedM";
|
|
|
|
return (
|
|
<>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="icon" type="image/x-icon" href="/static/ox.ico" />
|
|
<meta httpEquiv="Content-Language" content="en" />
|
|
<meta name="description" content={description} />
|
|
<meta name="og:title" content={title} />
|
|
<meta name="og:description" content={description} />
|
|
<meta name="og:url" content={url} />
|
|
</>
|
|
);
|
|
}
|
|
|
|
function useNextSeoProps() {
|
|
const { asPath } = useRouter();
|
|
const arr = asPath.replace(/[-_]/g, ' ').split('/');
|
|
const category = arr[1].replace(/(^\w|\s\w)/g, m => m.toUpperCase()) || 'Overextended'
|
|
const title = arr[arr.length - 1]
|
|
|
|
return {
|
|
titleTemplate: `${/[a-z]/.test(title) && /[A-Z]/.test(title) ? title : '%s'} - ${category}`,
|
|
};
|
|
}
|
|
|
|
const config: DocsThemeConfig = {
|
|
logo: (
|
|
<div
|
|
style={{
|
|
paddingLeft: '50px',
|
|
lineHeight: '38px',
|
|
background: "url('https://avatars.githubusercontent.com/u/88127058?s=38') no-repeat left",
|
|
backgroundSize: '38px',
|
|
fontWeight: 550,
|
|
}}
|
|
>
|
|
Overextended
|
|
</div>
|
|
),
|
|
project: {
|
|
link: 'https://github.com/overextended/overextended.github.io',
|
|
},
|
|
chat: {
|
|
link: 'https://discord.overextended.dev',
|
|
},
|
|
docsRepositoryBase: 'https://github.com/overextended/overextended.github.io/blob/main',
|
|
footer: {
|
|
text: 'Overextended',
|
|
},
|
|
// search: {
|
|
// component: <Search />,
|
|
// },
|
|
head: useHead,
|
|
primaryHue: { dark: 200, light: 200 },
|
|
sidebar: {
|
|
defaultMenuCollapseLevel: 1,
|
|
},
|
|
|
|
useNextSeoProps: useNextSeoProps,
|
|
};
|
|
|
|
export default config;
|