Advertisement
twokay

docusaurus.config.js

Sep 9th, 2022
866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // @ts-check
  2. // Note: type annotations allow type checking and IDEs autocompletion
  3.  
  4. const lightCodeTheme = require('prism-react-renderer/themes/github');
  5. const darkCodeTheme = require('prism-react-renderer/themes/dracula');
  6.  
  7. /** @type {import('@docusaurus/types').Config} */
  8. const config = {
  9.   title: 'Speechmatics',
  10.   tagline: 'Speechmatics - super special translation things',
  11.   url: 'https://speechmatics.com',
  12.   baseUrl: '/',
  13.   onBrokenLinks: 'throw',
  14.   onBrokenMarkdownLinks: 'warn',
  15.   favicon: 'img/favicon.ico',
  16.  
  17.   // GitHub pages deployment config.
  18.   // If you aren't using GitHub pages, you don't need these.
  19.   organizationName: 'speechmatics', // Usually your GitHub org/user name.
  20.   projectName: 'docusaurus', // Usually your repo name.
  21.  
  22.   // Even if you don't use internalization, you can use this field to set useful
  23.   // metadata like html lang. For example, if your site is Chinese, you may want
  24.   // to replace "en" with "zh-Hans".
  25.   i18n: {
  26.     defaultLocale: 'en',
  27.     locales: ['en'],
  28.   },
  29.  
  30.   presets: [
  31.     [
  32.       'classic',
  33.       /** @type {import('@docusaurus/preset-classic').Options} */
  34.       ({
  35.         docs: {
  36.           sidebarPath: require.resolve('./sidebars.js'),
  37.           // Please change this to your repo.
  38.           // Remove this to remove the "edit this page" links.
  39.           editUrl:
  40.             'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
  41.           docLayoutComponent: "@theme/DocPage",
  42.           docItemComponent: "@theme/ApiItem" // Derived from docusaurus-theme-openapi-docs
  43.         },
  44.         blog: {
  45.           showReadingTime: true,
  46.           // Please change this to your repo.
  47.           // Remove this to remove the "edit this page" links.
  48.           editUrl:
  49.             'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
  50.         },
  51.         theme: {
  52.           customCss: require.resolve('./src/css/custom.css'),
  53.         },
  54.       }),
  55.     ],
  56.   ],
  57.   plugins: [
  58.     [
  59.       'docusaurus-plugin-openapi-docs',
  60.       {
  61.         id: "apiDocs",
  62.         docsPluginId: "classic",
  63.         config: {
  64.           jobs: { // Note: petstore key is treated as the <id> and can be used to specify an API doc instance when using CLI commands
  65.             specPath: "api/jobs-internal.json", // Path to designated spec file
  66.             outputDir: "api/jobs", // Output directory for generated .mdx docs
  67.             sidebarOptions: {
  68.               groupPathsBy: "tag",
  69.               categoryLinkSource: "tag",
  70.             },
  71.             template: "api.mustache",          
  72.           },
  73.         }
  74.       },
  75.     ]
  76.   ],
  77.   themes: ["docusaurus-theme-openapi-docs"],
  78.   themeConfig:
  79.     /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
  80.     ({
  81.       navbar: {
  82.         title: 'Speechmatics',
  83.         logo: {
  84.           alt: 'Speechmatics',
  85.           src: 'img/logo.svg',
  86.         },
  87.         items: [
  88.           {
  89.             type: 'doc',
  90.             to: '/docs',
  91.             docId: 'intro',
  92.             position: 'left',
  93.             label: 'Docs',
  94.           },
  95.           { to: '/docs/api', label: 'Api', position: 'left' },
  96.           {
  97.             href: 'https://github.com/speechmatics',
  98.             label: 'Speechmatics',
  99.             position: 'right',
  100.           },
  101.         ],
  102.       },
  103.       footer: {
  104.         style: 'dark',
  105.         links: [
  106.           {
  107.             title: 'Docs',
  108.             items: [
  109.               {
  110.                 label: 'Tutorial',
  111.                 to: '/docs/intro',
  112.               },
  113.             ],
  114.           },
  115.           {
  116.             title: 'Community',
  117.             items: [
  118.               {
  119.                 label: 'Stack Overflow',
  120.                 href: 'https://stackoverflow.com/questions/tagged/docusaurus',
  121.               },
  122.               {
  123.                 label: 'Discord',
  124.                 href: 'https://discordapp.com/invite/docusaurus',
  125.               },
  126.               {
  127.                 label: 'Twitter',
  128.                 href: 'https://twitter.com/docusaurus',
  129.               },
  130.             ],
  131.           },
  132.           {
  133.             title: 'More',
  134.             items: [
  135.               {
  136.                 label: 'Blog',
  137.                 to: '/blog',
  138.               },
  139.               {
  140.                 label: 'GitHub',
  141.                 href: 'https://github.com/facebook/docusaurus',
  142.               },
  143.             ],
  144.           },
  145.         ],
  146.         copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
  147.       },
  148.       prism: {
  149.         theme: lightCodeTheme,
  150.         darkTheme: darkCodeTheme,
  151.       },
  152.     }),
  153. };
  154.  
  155. module.exports = config;
  156.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement