import React from 'react' import { useRouter } from 'next/router' import { useConfig } from 'nextra-theme-docs' import type { DocsThemeConfig } from 'nextra-theme-docs' const openllmUrl = 'https://openllm.community' const logo = ( ) const theme: DocsThemeConfig = { project: { link: 'https://github.com/bentoml/OpenLLM' }, editLink: { text: 'Edit this page on GitHub →' }, feedback: { content: 'Question? Send us your feedback →', labels: 'feedback' }, docsRepositoryBase: 'https://github.com/bentoml/OpenLLM/tree/main/docs', chat: { link: 'https://l.bentoml.com/join-openllm-discord' }, logo, head: function useHead() { const { frontMatter, title } = useConfig() // TODO: support locale // https://nextjs.org/docs/pages/api-reference/functions/use-router const { route } = useRouter() const socialCard = route === '/' || !title ? `${openllmUrl}/og.png` : `${openllmUrl}/api/og?title=${title}` const ogDescription = frontMatter.description || 'Fine-tune, serve and deploy LLMs in production' return ( <> > ) }, search: { placeholder: 'Search website...' }, toc: { float: true }, sidebar: { titleComponent({ title, type }) { if (type === 'separator') { return {title} } return <>{title}> }, defaultMenuCollapseLevel: 1, toggleButton: true }, gitTimestamp({ timestamp }) { const { locale } = useRouter() return ( <> 'last updated on ' > ) }, useNextSeoProps() { const { asPath } = useRouter() if (['/', '/docs'].includes(asPath)) { return { titleTemplate: 'OpenLLM' } } return { titleTemplate: `%s | OpenLLM` } }, footer: { text: (
) } } export default theme