Skip to content

Commit

Permalink
add head
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Oct 11, 2023
1 parent 7353947 commit ef5ab49
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/theme.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useConfig } from "nextra-theme-docs";
import React from "react";
import { useRouter } from "next/router";

/* eslint sort-keys: error */
/**
Expand All @@ -24,6 +25,26 @@ export default {
</span>
),
},
head: () => {
const { asPath, defaultLocale, locale } = useRouter();
const { title } = useConfig();
const url =
"https://starship.cosmology.tech/" +
(defaultLocale === locale ? asPath : `/${locale}${asPath}`);

const _title = asPath !== "/" ? `${title} - Cosmology` : `${title}`;
return (
<>
<meta property="og:url" content={url} />
<meta property="og:title" content={_title} />
<meta
property="og:description"
content={"Unified development environment"}
/>
<title>{_title}</title>
</>
);
},
chat: {
link: "https://discord.gg/6hy8KQ9aJY",
},
Expand Down

0 comments on commit ef5ab49

Please sign in to comment.