import type { Options, ThemeConfig } from '@docusaurus/preset-classic'
import type { Config } from '@docusaurus/types'
import { join } from 'node:path'
import type { PresetOptions } from 'redocusaurus'
const title = 'Chronocat'
const tagline = '模块化的 Satori 框架'
const logo = {
alt: 'Chronocat Logo',
src: 'chronocat.svg',
href: '/',
}
const presetConfig: Options = {
docs: {
routeBasePath: '/',
sidebarPath: join(__dirname, 'sidebars.ts'),
editUrl:
'https://github.com/chrononeko/chronocat/tree/master/packages/docs',
},
blog: {
postsPerPage: 'ALL',
blogSidebarCount: 0,
},
theme: {
customCss: join(__dirname, 'src/css/custom.scss'),
},
}
const redocusaurusConfig: PresetOptions = {
specs: [
{
id: 'openapi',
spec: 'static/openapi.yaml',
url: 'https://chronocat.vercel.app/openapi.yaml',
route: '/develop/satori/reference/api',
layout: {
title: 'API 参考',
},
},
],
theme: {
primaryColor: '#2e8555',
primaryColorDark: '#25c2a0',
},
}
const themeConfig: ThemeConfig = {
colorMode: {
defaultMode: 'light',
respectPrefersColorScheme: true,
},
image: 'chronocat.svg',
metadata: [
{
name: 'description',
content: tagline,
},
{
name: 'keywords',
content:
'Chronocat, Crychiccat, Yukihana, Curinacat, Red, Chrononeko, RedProtocol, BetterQQNT, LiteLoaderQQNT, QQNTim, NoneBot, NoneBot2, Koishi, Koishi.js, Bot, Chatbot, 机器人, OneBot, QQ',
},
],
navbar: {
title,
logo,
items: [
{
label: '使用',
position: 'left',
to: 'guide/install/shell',
activeBasePath: 'guide',
},
{
label: '开发',
position: 'left',
to: 'develop',
},
{
label: '更多',
position: 'left',
type: 'dropdown',
items: [
{
label: 'FAQ',
to: 'faq/1',
},
{
label: '错误码',
to: 'code/all',
},
{
label: '博客',
to: 'blog',
},
{
label: '更多内容',
to: 'more',
},
],
},
{
label: 'v0.2',
position: 'right',
type: 'dropdown',
items: [
{
label: 'v0.1',
href: 'https://chronocat.vercel.app/v01',
},
],
},
{
href: 'https://github.com/chrononeko/chronocat',
html: '',
position: 'right',
},
],
},
footer: {
style: 'dark',
logo: {
...logo,
width: 80,
},
links: [
{
title: '使用',
items: [
{
label: '安装 Chronocat',
to: '/guide/install/shell',
},
{
label: '安装引擎',
to: '/guide/install/engine',
},
{
label: '接入',
to: '/guide/connect',
},
{
label: '配置',
to: '/guide/config',
},
],
},
{
title: '开发',
items: [
{
label: 'Satori',
to: '/develop/satori',
},
],
},
{
title: '更多',
items: [
{
label: 'FAQ',
to: '/faq/1',
},
{
label: '错误码',
to: '/code/all',
},
{
label: '博客',
to: '/blog',
},
{
label: '更多内容',
to: '/more',
},
{
label: '全站搜索',
to: '/search',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Team Chrononeko`,
},
docs: {
sidebar: {
autoCollapseCategories: true,
},
},
prism: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
theme: require('prism-react-renderer/themes/github'),
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
darkTheme: require('prism-react-renderer/themes/palenight'),
},
announcementBar: {
id: 'do_not_promote',
content:
'为了避免此前的事件再次发生,请勿在任何公众平台分享或宣传 Chronocat。',
textColor: 'var(--ifm-heading-color)',
backgroundColor: 'var(--ifm-background-color)',
isCloseable: false,
},
}
export const config: Config = {
title,
tagline,
url: 'https://chronocat.vercel.app',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'chronocat.ico',
organizationName: 'chrononeko',
projectName: 'chronocat',
i18n: {
defaultLocale: 'zh-Hans',
locales: ['zh-Hans'],
},
presets: [
['classic', presetConfig],
['redocusaurus', redocusaurusConfig],
],
plugins: ['docusaurus-plugin-sass'],
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
{
hashed: true,
language: ['en', 'zh'],
docsRouteBasePath: '/',
},
],
],
themeConfig,
markdown: {
mdx1Compat: {
admonitions: false,
comments: false,
headingIds: false,
},
},
}