Files
candy/docs/docusaurus.config.ts
2024-12-30 13:32:18 +08:00

144 lines
3.7 KiB
TypeScript

import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';
const config: Config = {
title: 'Candy',
tagline: 'Tiny http web server',
favicon: 'img/favicon.ico',
future: {
experimental_faster: true,
},
// Set the production url of your site here
url: 'https://your-docusaurus-site.example.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'xfy', // Usually your GitHub org/user name.
projectName: 'candy', // Usually your repo name.
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'zh-Hans',
locales: ['en', 'zh-Hans'],
},
presets: [
[
'classic',
{
docs: {
/* routeBasePath: '/', */
sidebarPath: './sidebars.ts',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://github.com/DefectingCat/candy/tree/main/docs',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://github.com/DefectingCat/candy/tree/main/docs',
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
colorMode: {
respectPrefersColorScheme: true,
},
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'RUA',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Tutorial',
},
{ to: '/blog', label: 'Blog', position: 'left' },
{
type: 'localeDropdown',
position: 'right',
},
{
href: 'https://github.com/DefectingCat',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
/* links: [
{
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/DefectingCat/candy',
},
],
},
], */
copyright: `Copyright © ${new Date().getFullYear()} Candy, Inc. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};
export default config;