diff --git a/docs/website/theme.config.tsx b/docs/website/theme.config.tsx index 259cc866ab..cbdf50fe49 100644 --- a/docs/website/theme.config.tsx +++ b/docs/website/theme.config.tsx @@ -71,13 +71,12 @@ const theme: DocsThemeConfig = { }, head: function useHead() { const { title, frontMatter } = useConfig() - const { asPath, locale, defaultLocale } = useRouter() - const currentLang = locale + const { asPath } = useRouter() + const router = useRouter() + const currentLang = router.locale let pageTitle = title || 'Rooch Network' - let pageDescription = - frontMatter.description || 'Unlocking infinite utility for the Bitcoin Economy' + let pageDescription = frontMatter.description || '' let ogImage = 'https://rooch.network/logo/rooch-banner.png' - const url = `https://rooch.network${defaultLocale === locale ? asPath : `/${locale}${asPath}`}` if (asPath.includes('/blog/')) { const contents = getPagesUnderRoute('/blog') as Content[] @@ -85,8 +84,12 @@ const theme: DocsThemeConfig = { (content): content is Page => isPage(content) && content.route === asPath, ) if (currentPage) { - pageTitle = currentPage.frontMatter.title + ' – Rooch Network' - pageDescription = currentPage.frontMatter.description || pageDescription + if (currentPage.frontMatter.title) { + pageTitle = currentPage.frontMatter.title + ' – Rooch Network' + } + if (currentPage.frontMatter.description) { + pageDescription = currentPage.frontMatter.description + } if (currentPage.frontMatter.image) { ogImage = `https://rooch.network${currentPage.frontMatter.image}` } @@ -103,17 +106,18 @@ const theme: DocsThemeConfig = { - - - + {/* MULTI-LANGUAGES */} + + + + {/* WEBSITE */} - - + {/* TWITTER */} @@ -121,6 +125,7 @@ const theme: DocsThemeConfig = { + {/* FAVICON */}