fix: make the metadata for documentation pages dynamically generated
This commit is contained in:
parent
a556cd404e
commit
9c547b4a9f
1 changed files with 44 additions and 31 deletions
|
@ -1,39 +1,52 @@
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import { useConfig } from "nextra-theme-docs";
|
||||||
import Logo from "./components/shared/Logo";
|
import Logo from "./components/shared/Logo";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
head: (
|
head: function Head() {
|
||||||
<>
|
const { asPath, defaultLocale, locale } = useRouter();
|
||||||
<meta
|
const { frontMatter } = useConfig();
|
||||||
name="description"
|
const url = `https://svrjs.org/${asPath}`;
|
||||||
content="The SVR.JS documentation provides comprehensive information and instructions on how to use and configure the SVR.JS web server. This documentation is also a valuable resource for web developers."
|
|
||||||
/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
|
|
||||||
<meta property="og:title" content="Documentation - SVR.JS" />
|
return (
|
||||||
<meta
|
<>
|
||||||
property="og:description"
|
<meta
|
||||||
content="The SVR.JS documentation provides comprehensive information and instructions on how to use and configure the SVR.JS web server. This documentation is also a valuable resource for web developers."
|
name="description"
|
||||||
/>
|
content="The SVR.JS documentation provides comprehensive information and instructions on how to use and configure the SVR.JS web server. This documentation is also a valuable resource for web developers."
|
||||||
<meta property="og:type" content="website" />
|
/>
|
||||||
<meta property="og:url" content="https://svrjs.org" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta
|
|
||||||
property="og:image"
|
<meta
|
||||||
content="https://svrjs.vercel.app/metadata/svrjs-cover.png"
|
property="og:title"
|
||||||
/>
|
content={(frontMatter.title || "Documentation") + " - SVR.JS"}
|
||||||
<title>Documentation - SVR.JS</title>
|
/>
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta
|
||||||
<meta name="twitter:title" content="Documentation - SVR.JS" />
|
property="og:description"
|
||||||
<meta
|
content="The SVR.JS documentation provides comprehensive information and instructions on how to use and configure the SVR.JS web server. This documentation is also a valuable resource for web developers."
|
||||||
name="twitter:description"
|
/>
|
||||||
content="The SVR.JS documentation provides comprehensive information and instructions on how to use and configure the SVR.JS web server. This documentation is also a valuable resource for web developers."
|
<meta property="og:type" content="website" />
|
||||||
/>
|
<meta property="og:url" content={url} />
|
||||||
<meta
|
<meta
|
||||||
name="twitter:image"
|
property="og:image"
|
||||||
content="https://svrjs.vercel.app/metadata/svrjs-cover.png"
|
content="https://svrjs.vercel.app/metadata/svrjs-cover.png"
|
||||||
/>
|
/>
|
||||||
</>
|
<title>{(frontMatter.title || "Documentation") + " - SVR.JS"}</title>
|
||||||
),
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
<meta
|
||||||
|
name="twitter:title"
|
||||||
|
content={(frontMatter.title || "Documentation") + " - SVR.JS"}
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
name="twitter:description"
|
||||||
|
content="The SVR.JS documentation provides comprehensive information and instructions on how to use and configure the SVR.JS web server. This documentation is also a valuable resource for web developers."
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
name="twitter:image"
|
||||||
|
content="https://svrjs.vercel.app/metadata/svrjs-cover.png"
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
},
|
||||||
editLink: {
|
editLink: {
|
||||||
component: null
|
component: null
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue