import { useRouter } from "next/router"; import { type DocsThemeConfig, useConfig } from "nextra-theme-docs"; import "nextra-theme-docs/style.css"; import faviconFormats from "./favicon-formats"; import styles from "./global.module.css"; const NO_INDEX_FOLLOW = process.env.CF_PAGES_BRANCH !== "main"; const config: DocsThemeConfig = { logo: ( ), head: () => { const { asPath, locale, defaultLocale } = useRouter(); const { frontMatter } = useConfig(); const url = `https://hyperglass.dev${ defaultLocale === locale ? asPath : `/${locale}${asPath}` }`; let title = frontMatter.title || "hyperglass"; if (title !== "hyperglass") { title = `${title} | hyperglass`; } const description = frontMatter.description || "hyperglass Documentation"; const index = NO_INDEX_FOLLOW ? "noindex, nofollow" : "index, follow"; const favicons = faviconFormats.map((fmt) => { const { image_format, dimensions, prefix, rel } = fmt; const [w, h] = dimensions; const href = `/img/${prefix}-${w}x${h}.${image_format}`; return { rel: rel ?? "", href, type: `image/${image_format}` }; }); return (