tabby/website/docusaurus.config.js

174 lines
4.7 KiB
JavaScript
Raw Normal View History

2023-06-06 01:33:54 +00:00
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Tabby',
tagline: 'Opensource, self-hosted AI coding assitant',
// FIXME(meng): favicon
// favicon: 'img/favicon.ico',
// Set the production url of your site here
url: 'https://tabbyml.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/tabby',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'TabbyML', // Usually your GitHub org/user name.
projectName: 'tabby', // Usually your repo name.
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
// Even if you don't use internalization, 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: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/TabbyML/tabby/tree/main/website',
2023-06-06 01:33:54 +00:00
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
[
'redocusaurus',
({
// Plugin Options for loading OpenAPI files
specs: [
{
spec: 'static/openapi.json',
route: '/api/',
},
],
// Theme Options for modifying how redoc renders them
theme: {
// Change with your site colors
primaryColor: '#2e8555',
},
}),
],
2023-06-06 01:33:54 +00:00
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// FIXME(meng): set social card.
// image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'Tabby',
logo: {
alt: 'Tabby',
src: 'img/logo.png',
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Docs',
2023-06-06 01:33:54 +00:00
},
{to: '/api', label: 'API', position: 'left'},
2023-06-06 01:33:54 +00:00
// FIXME(meng): enable blog.
// {to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/TabbyML/tabby',
label: 'GitHub',
position: 'right',
className: "header-github-link",
2023-06-06 01:33:54 +00:00
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
2023-06-06 11:27:15 +00:00
label: 'Configuration',
2023-06-06 02:46:54 +00:00
to: '/docs/server',
2023-06-06 01:33:54 +00:00
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/tabby',
},
{
label: 'Twitter',
href: 'https://twitter.com/mzh1024',
},
],
},
{
title: 'More',
items: [
/*
{
label: 'Blog',
to: '/blog',
},
*/
{
label: 'GitHub',
href: 'https://github.com/TabbyML/tabby',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} TabbyML, Inc.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
plugins: [
async function tailwind(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
]
2023-06-06 01:33:54 +00:00
};
module.exports = config;