697d3773c8
Co-authored-by: Copilot <copilot@github.com>
194 lines
4.4 KiB
TypeScript
194 lines
4.4 KiB
TypeScript
import type { Config } from '@docusaurus/types';
|
|
import type * as Preset from '@docusaurus/preset-classic';
|
|
import remarkMath from 'remark-math';
|
|
import rehypeKatex from 'rehype-katex';
|
|
import { config as loadEnv } from 'dotenv';
|
|
|
|
loadEnv({ path: '.env.local' });
|
|
|
|
const config: Config = {
|
|
title: 'CodeDocs 编程文档',
|
|
tagline: 'CodeDocs 编程文档 -- 这里是一些技术人的编程文档',
|
|
url: 'http://docs.yaoyuan.io/',
|
|
baseUrl: '/',
|
|
onBrokenLinks: 'throw',
|
|
onBrokenMarkdownLinks: 'warn',
|
|
favicon: 'img/favicon.ico',
|
|
organizationName: 'chuyaoyuan',
|
|
projectName: 'code-docs',
|
|
|
|
i18n: {
|
|
defaultLocale: 'zh-cn',
|
|
locales: ['zh-cn', 'en'],
|
|
localeConfigs: {
|
|
'zh-cn': {
|
|
label: '中文',
|
|
direction: 'ltr',
|
|
htmlLang: 'zh-CN',
|
|
},
|
|
en: {
|
|
label: 'English',
|
|
direction: 'ltr',
|
|
htmlLang: 'en-US',
|
|
},
|
|
},
|
|
},
|
|
|
|
themeConfig: {
|
|
algolia: {
|
|
apiKey: process.env.ALGOLIA_API_KEY ?? '',
|
|
appId: process.env.ALGOLIA_APP_ID ?? '',
|
|
indexName: 'code-docs',
|
|
contextualSearch: true,
|
|
searchParameters: {},
|
|
},
|
|
navbar: {
|
|
title: 'CodeDocs 编程文档',
|
|
logo: {
|
|
alt: 'CodeDocs 编程文档',
|
|
src: 'img/logo.svg',
|
|
},
|
|
items: [
|
|
{
|
|
type: 'dropdown',
|
|
label: '📚 技术文档',
|
|
position: 'left',
|
|
items: [
|
|
{
|
|
type: 'doc',
|
|
docId: 'backend-doc/intro-docs',
|
|
label: '⚙️ 后端技术',
|
|
},
|
|
{
|
|
type: 'doc',
|
|
docId: 'frontend-doc/intro-docs',
|
|
label: '⚛️ 前端开发',
|
|
},
|
|
{
|
|
type: 'doc',
|
|
docId: 'LeetCode/intro-docs',
|
|
label: '🧠 算法与面试',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'dropdown',
|
|
label: '🛠️ 工具与资源',
|
|
position: 'left',
|
|
items: [
|
|
{
|
|
label: '📖 最佳实践',
|
|
href: '#',
|
|
},
|
|
{
|
|
label: '🔗 常用链接',
|
|
href: '#',
|
|
},
|
|
{
|
|
label: '📚 推荐阅读',
|
|
href: '#',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
to: '/blog',
|
|
label: '📝 Blog',
|
|
position: 'left'
|
|
},
|
|
{
|
|
href: 'https://github.com/chuyaoyuan/code-docs',
|
|
label: 'GitHub',
|
|
position: 'right',
|
|
},
|
|
{
|
|
type: 'localeDropdown',
|
|
position: 'right',
|
|
},
|
|
],
|
|
},
|
|
footer: {
|
|
style: 'dark',
|
|
links: [
|
|
{
|
|
title: '文档',
|
|
items: [
|
|
{
|
|
label: 'CodeDocs',
|
|
to: '/docs/intro-docs',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: '第三方链接',
|
|
items: [
|
|
{
|
|
label: 'Stack Overflow',
|
|
href: 'https://stackoverflow.com/',
|
|
},
|
|
{
|
|
label: 'Discord',
|
|
href: 'https://discordapp.com/',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: '开发团队',
|
|
items: [
|
|
{
|
|
label: 'chuyaoyuan',
|
|
href: 'https://github.com/chuyaoyuan/',
|
|
},
|
|
{
|
|
label: 'zhangbohou',
|
|
href: 'https://github.com/BohouZhang',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: '更多',
|
|
items: [
|
|
{
|
|
label: 'Blog',
|
|
to: '/blog',
|
|
},
|
|
{
|
|
label: 'GitHub',
|
|
href: 'https://github.com/chuyaoyuan/code-docs',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
copyright: `Copyright © ${new Date().getFullYear()} Code Docs, Inc. 一些技术人的编程文档网站.`,
|
|
},
|
|
} satisfies Preset.ThemeConfig,
|
|
|
|
stylesheets: [
|
|
{
|
|
href: 'https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css',
|
|
type: 'text/css',
|
|
crossorigin: 'anonymous',
|
|
},
|
|
],
|
|
|
|
presets: [
|
|
[
|
|
'classic',
|
|
{
|
|
docs: {
|
|
sidebarPath: './sidebars.ts',
|
|
remarkPlugins: [remarkMath],
|
|
rehypePlugins: [rehypeKatex],
|
|
},
|
|
blog: {
|
|
showReadingTime: true,
|
|
},
|
|
theme: {
|
|
customCss: './src/css/custom.css',
|
|
},
|
|
} satisfies Preset.Options,
|
|
],
|
|
],
|
|
};
|
|
|
|
export default config;
|