mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 14:38:50 +00:00
seo tweaks
This commit is contained in:
1 parent
14609569d7
commit
084dc2f558
1 file changed
+12
-10
+12
-10
@@ -4,17 +4,27 @@ import { useRouter } from 'next/router';
|
|||||||
import Search from '@components/Search';
|
import Search from '@components/Search';
|
||||||
|
|
||||||
function useHead() {
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="icon" type="image/x-icon" href="/static/ox.ico" />
|
<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() {
|
function useNextSeoProps() {
|
||||||
const path = useRouter().asPath;
|
const { asPath } = useRouter();
|
||||||
const arr = path.split('/');
|
const arr = asPath.split('/');
|
||||||
const title = arr[arr.length - 1].replace(/[-_]/g, ' ');
|
const title = arr[arr.length - 1].replace(/[-_]/g, ' ');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -53,14 +63,6 @@ const config: DocsThemeConfig = {
|
|||||||
primaryHue: { dark: 200, light: 200 },
|
primaryHue: { dark: 200, light: 200 },
|
||||||
sidebar: {
|
sidebar: {
|
||||||
defaultMenuCollapseLevel: 1,
|
defaultMenuCollapseLevel: 1,
|
||||||
// titleComponent({ title, type }) {
|
|
||||||
// return (
|
|
||||||
// <>
|
|
||||||
// {title[0].toUpperCase()}
|
|
||||||
// {title.slice(1)}
|
|
||||||
// </>
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
|
|
||||||
useNextSeoProps: useNextSeoProps,
|
useNextSeoProps: useNextSeoProps,
|
||||||
|
|||||||
Reference in new issue
Block a user