Files
overextended.github.io/theme.config.tsx
T
2023-06-05 00:23:17 +10:00

73 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from 'react';
import { DocsThemeConfig, useConfig } from 'nextra-theme-docs';
import { useRouter } from 'next/router';
import Search from '@components/Search';
function useHead() {
const { title } = useConfig();
return (
<>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="ox.ico" />
<title>{`${title} – Overextended`}</title>
</>
);
}
function useNextSeoProps() {
const path = useRouter().asPath;
const arr = path.split('/');
const title = arr[arr.length - 1].replace(/[-_]/g, ' ');
return {
titleTemplate: /[a-z]/.test(title) && /[A-Z]/.test(title) ? title : '%s',
};
}
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.gg/hmcmv3P7YW',
},
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,
// titleComponent({ title, type }) {
// return (
// <>
// {title[0].toUpperCase()}
// {title.slice(1)}
// </>
// );
// },
},
useNextSeoProps: useNextSeoProps,
};
export default config;