text: const path = require('path');
  
  const BASE_URL = '/docs';
  
  module.exports = {
    title: 'Ionic Documentation',
    tagline:
      'Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards',
    url: 'https://ionicframework.com',
    baseUrl: `${BASE_URL}/`,
    /*
    i18n: {
      defaultLocale: 'en',
      locales: ['en', 'es', 'fr', 'pt', 'zh'],
      localeConfigs: {
        en: { label: 'English' },
        es: { label: 'Español' },
        fr: { label: 'Français' },
        pt: { label: 'Português' },
        zh: { label: '中文' },
      },
    },
    */
    onBrokenLinks: 'warn',
    onBrokenMarkdownLinks: 'warn',
    favicon: 'img/meta/favicon.ico',
    organizationName: 'ionic-team',
    projectName: 'ionic-docs',
    themeConfig: {
      colorMode: {
        defaultMode: 'light',
      },
      navbar: {
        hideOnScroll: true,
        logo: {
          alt: 'Site Logo',
          src: `${BASE_URL}/logos/ionic-text-docs-dark.svg`,
          srcDark: `${BASE_URL}/logos/ionic-text-docs-light.svg`,
          href: '/',
          target: '_self',
          width: 139,
          height: 28,
        },
        items: [
          {
            type: 'doc',
            docId: 'index',
            label: 'Guide',
            position: 'left',
          },
          {
            type: 'doc',
            docId: 'components',
            label: 'Components',
            position: 'left',
          },
          {
            type: 'doc',
            docId: 'cli',
            label: 'CLI',
            position: 'left',
          },
          {
            type: 'doc',
            docId: 'native',
            label: 'Native',
            position: 'left',
          },
          {
            type: 'docsVersionDropdown',
            position: 'right',
            dropdownItemsAfter: [
              { to: 'https://ionicframework.com/docs/v4/components', label: 'v4', target: '_blank' },
              { to: 'https://ionicframework.com/docs/v3/', label: 'v3', target: '_blank' },
            ],
            // dropdownItemsAfter: [{to: '/versions', label: 'All versions'}],
            dropdownActiveClassDisabled: true,
          },
          {
            type: 'search',
            position: 'right',
          },
          {
            label: 'Community',
            position: 'right',
            items: [
              {
                href: 'https://ionicframework.com/community',
                label: 'Community Hub',
                target: '_blank',
                rel: null,
              },
              {
                href: 'https://forum.ionicframework.com/',
                label: 'Forum',
                target: '_blank',
                rel: null,
              },
              {
                href: 'https://www.meetup.com/topics/ionic-framework/',
                label: 'Meetups',
                target: '_blank',
                rel: null,
              },
              {
                href: 'https://blog.ionicframework.com/',
                label: 'Blog',
                target: '_blank',
                rel: null,
              },
              {
                href: 'https://twitter.com/ionicframework',
                label: 'Twitter',
                target: '_blank',
                rel: null,
              },
            ],
            className: 'navbar__link--community',
          },
          {
            label: 'Support',
            position: 'right',
            items: [
              {
                href: 'https://ionicframework.com/support',
                label: 'Help Center',
                target: '_blank',
                rel: null,
              },
              {
                href: 'https://ionic.zendesk.com/',
                label: 'Customer Support',
                target: '_blank',
                rel: null,
              },
              {
                href: 'https://ionicframework.com/advisory',
                label: 'Enterprise Advisory',
                target: '_blank',
                rel: null,
              },
            ],
            className: 'navbar__link--support',
          },
          {
            type: 'separator',
            position: 'right',
          },
          // {
          //   type: 'localeDropdown',
          //   position: 'right',
          //   dropdownItemsBefore: [],
          //   dropdownItemsAfter: [
          //     {
          //       href: 'https://ionicframework.com/jp/docs/',
          //       label: '日本語',
          //       target: '_blank',
          //       rel: null,
          //     },
          //     {
          //       href: 'https://ionicframework.com/translate',
          //       label: 'Translate',
          //       target: '_blank',
          //       rel: null,
          //     },
          //   ],
          //   className: 'icon-link language navbar__item',
          // },
          {
            type: 'iconLink',
            position: 'right',
            icon: {
              alt: 'twitter logo',
              src: `${BASE_URL}/logos/twitter.svg`,
              href: 'https://twitter.com/Ionicframework',
              target: '_blank',
            },
          },
          {
            type: 'iconLink',
            position: 'right',
            icon: {
              alt: 'github logo',
              src: `${BASE_URL}/logos/github.svg`,
              href: 'https://github.com/ionic-team/ionic-framework',
              target: '_blank',
            },
          },
          {
            type: 'iconLink',
            position: 'right',
            icon: {
              alt: 'discord logo',
              src: `${BASE_URL}/logos/discord.svg`,
              href: 'https://ionic.link/discord',
              target: '_blank',
            },
          },
        ],
      },
      tagManager: {
        trackingID: 'GTM-TKMGCBC',
      },
      prism: {
        theme: { plain: {}, styles: [] },
        // https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/vendor/prism/includeLangs.js
        additionalLanguages: ['shell-session', 'http'],
      },
      algolia: {
        apiKey: '43228ce75714201a27efcf69666d6b40',
        indexName: 'ionicframework',
        contextualSearch: true,
      },
    },
    plugins: [
      'docusaurus-plugin-sass',
      [
        'docusaurus-plugin-module-alias',
        {
          alias: {
            'styled-components': path.resolve(__dirname, './node_modules/styled-components'),
            react: path.resolve(__dirname, './node_modules/react'),
            'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
            '@components': path.resolve(__dirname, './src/components'),
          },
        },
      ],
      [
        '@docusaurus/plugin-content-docs',
        {
          routeBasePath: '/',
          sidebarPath: require.resolve('./sidebars.js'),
          editUrl: ({ versionDocsDirPath, docPath, locale }) => {
            if (locale != 'en') {
              return 'https://crowdin.com/project/ionic-docs';
            }
            if ((match = docPath.match(/api\/(.*)\.md/)) != null) {
              return `https://github.com/ionic-team/ionic-framework/edit/main/core/src/components/${match[1]}/readme.md`;
            }
            if ((match = docPath.match(/cli\/commands\/(.*)\.md/)) != null) {
              return `https://github.com/ionic-team/ionic-cli/edit/develop/packages/@ionic/cli/src/commands/${match[1].replace(
                '-',
                '/'
              )}.ts`;
            }
            if ((match = docPath.match(/native\/(.*)\.md/)) != null) {
              return `https://github.com/ionic-team/ionic-native/edit/master/src/@awesome-cordova-plugins/plugins/${match[1]}/index.ts`;
            }
            return `https://github.com/ionic-team/ionic-docs/edit/main/${versionDocsDirPath}/${docPath}`;
          },
          exclude: ['README.md'],
          lastVersion: 'v5',
          versions: {
            current: {
              label: 'v6',
              banner: 'none',
            },
          },
        },
      ],
      '@docusaurus/plugin-content-pages',
      '@docusaurus/plugin-debug',
      '@docusaurus/plugin-sitemap',
      '@ionic-internal/docusaurus-plugin-tag-manager',
    ],
    themes: [
      [
        //overriding the standard docusaurus-theme-classic to provide custom schema
        path.resolve(__dirname, 'docusaurus-theme-classic'),
        {
          customCss: [
            require.resolve('./node_modules/modern-normalize/modern-normalize.css'),
            require.resolve('./node_modules/@ionic-internal/ionic-ds/dist/tokens/tokens.css'),
            require.resolve('./src/styles/custom.scss'),
          ],
        },
      ],
      path.resolve(__dirname, './node_modules/@docusaurus/theme-search-algolia'),
    ],
    customFields: {},
  };
  