Open manojadams opened 1 year ago
Following example to change head tags does not work:
import { useRouter } from 'next/router' import { useConfig } from 'nextra-theme-docs' export default { head: () => { const { asPath, defaultLocale, locale } = useRouter() const { frontMatter } = useConfig() const url = 'https://my-app.com' + (defaultLocale === locale ? asPath : `/${locale}${asPath}`) return ( <> <meta property="og:url" content={url} /> <meta property="og:title" content={frontMatter.title || 'Nextra'} /> <meta property="og:description" content={frontMatter.description || 'The next site builder'} /> </> ) } }
You can check this example config here, it works: https://github.com/shuding/nextra/issues/2311#issuecomment-1735810350
Following example to change head tags does not work: