seo tweaks

This commit is contained in:
Linden committed 2023-06-09 18:25:50 +10:00
1 parent 14609569d7
commit 084dc2f558
1 file changed
+12 -10
+12 -10
View File
@@ -4,17 +4,27 @@ 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 path = useRouter().asPath;
const arr = path.split('/');
const { asPath } = useRouter();
const arr = asPath.split('/');
const title = arr[arr.length - 1].replace(/[-_]/g, ' ');
return {
@@ -53,14 +63,6 @@ const config: DocsThemeConfig = {
primaryHue: { dark: 200, light: 200 },
sidebar: {
defaultMenuCollapseLevel: 1,
// titleComponent({ title, type }) {
// return (
// <>
// {title[0].toUpperCase()}
// {title.slice(1)}
// </>
// );
// },
},
useNextSeoProps: useNextSeoProps,