import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
  title: 'CaDaR Documentation',
  tagline: 'Canonicalization and Darija Representation - Bidirectional transliteration for Moroccan Arabic',
  favicon: 'img/favicon.ico',

  // Set the production url of your site here
  url: 'https://oit-technologies.github.io',
  // Set the /<baseUrl>/ pathname under which your site is served
  baseUrl: '/CaDaR/',

  // GitHub pages deployment config.
  organizationName: 'Oit-Technologies',
  projectName: 'CaDaR',

  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: 'en',
    locales: ['en'],
  },

  presets: [
    [
      'classic',
      {
        docs: {
          sidebarPath: './sidebars.ts',
          // Please change this to your repo.
          editUrl: 'https://github.com/Oit-Technologies/CaDaR/tree/main/cadar-docs/',
        },
        blog: false,
        theme: {
          customCss: './src/css/custom.css',
        },
      } satisfies Preset.Options,
    ],
  ],

  themeConfig: {
    navbar: {
      title: 'CaDaR',
      logo: {
        alt: 'CaDaR Logo',
        src: 'img/logo.svg',
      },
      items: [
        {
          type: 'docSidebar',
          sidebarId: 'tutorialSidebar',
          position: 'left',
          label: 'Documentation',
        },
        {
          to: '/playground',
          label: 'Playground',
          position: 'left',
        },
        {
          href: 'https://github.com/Oit-Technologies/CaDaR',
          label: 'GitHub',
          position: 'right',
        },
        {
          href: 'https://pypi.org/project/cadar/',
          label: 'PyPI',
          position: 'right',
        },
      ],
    },
    footer: {
      style: 'dark',
      links: [
        {
          title: 'Documentation',
          items: [
            {
              label: 'Getting Started',
              to: '/docs/intro',
            },
            {
              label: 'API Reference',
              to: '/docs/api/python',
            },
            {
              label: 'Architecture',
              to: '/docs/architecture/pipeline',
            },
          ],
        },
        {
          title: 'Community',
          items: [
            {
              label: 'GitHub',
              href: 'https://github.com/Oit-Technologies/CaDaR',
            },
            {
              label: 'Issues',
              href: 'https://github.com/Oit-Technologies/CaDaR/issues',
            },
            {
              label: 'Discussions',
              href: 'https://github.com/Oit-Technologies/CaDaR/discussions',
            },
          ],
        },
        {
          title: 'More',
          items: [
            {
              label: 'PyPI',
              href: 'https://pypi.org/project/cadar/',
            },
            {
              label: 'Changelog',
              to: '/docs/changelog',
            },
          ],
        },
      ],
      copyright: `Copyright © ${new Date().getFullYear()} Oit Technologies. Built with Docusaurus.`,
    },
    prism: {
      theme: prismThemes.github,
      darkTheme: prismThemes.dracula,
    },
  } satisfies Preset.ThemeConfig,

  plugins: [
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'api',
        path: 'api',
        routeBasePath: 'api',
        sidebarPath: './sidebars.ts',
      },
    ],
    '@docusaurus/theme-mermaid',
  ],
};

export default config;
