import type * as Preset from '@docusaurus/preset-classic'; import type {Config} from '@docusaurus/types'; import {themes as prismThemes} from 'prism-react-renderer'; // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) const baseUrl = process.env.BASE_URL || '/'; const config: Config = { title: 'XR Blocks', tagline: 'XR and AI for the Web', favicon: 'img/favicon.ico', // Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future future: { v4: true, // Improve compatibility with the upcoming Docusaurus v4 }, // Set the production url of your site here url: process.env.URL || 'https://your-docusaurus-site.example.com', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: baseUrl, trailingSlash: true, // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. organizationName: 'google', // Usually your GitHub org/user name. projectName: 'xrblocks', // Usually your repo name. onBrokenLinks: 'throw', // 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'], }, customFields: { xrblocksBaseUrl: process.env.XRBLOCKS_BASE_URL || 'http://localhost:8080/', codeSearchBaseUrl: process.env.CODE_SEARCH_BASE_URL || 'https://github.com/google/xrblocks/blob/main/', codeSearchLinkSuffix: process.env.CODE_SEARCH_LINK_SUFFIX || '', }, headTags: [ { tagName: 'link', attributes: { rel: 'icon', href: baseUrl + 'img/favicon.ico', sizes: 'any', }, }, { tagName: 'link', attributes: { rel: 'icon', href: baseUrl + 'img/favicon.svg', type: 'image/svg+xml', }, }, { tagName: 'link', attributes: { rel: 'apple-touch-icon', href: baseUrl + 'img/apple-touch-icon.png', sizes: '180x180', }, }, { tagName: 'link', attributes: { rel: 'icon', href: baseUrl + 'img/web-app-manifest-192x192.png', sizes: '192x192', type: 'image/png', }, }, { tagName: 'link', attributes: { rel: 'icon', href: baseUrl + 'img/web-app-manifest-512x512.png', sizes: '512x512', type: 'image/png', }, }, { tagName: 'link', attributes: { rel: 'manifest', href: baseUrl + 'img/site.webmanifest', }, }, { tagName: 'meta', attributes: { name: 'algolia-site-verification', content: 'C7A25C1609F793C8', }, }, ], presets: [ [ 'classic', { docs: { sidebarPath: './sidebars.ts', routeBasePath: '/', }, theme: { customCss: './src/css/custom.css', }, gtag: { trackingID: 'G-5EK2RWYHRM', anonymizeIP: true, }, } satisfies Preset.Options, ], ], themeConfig: { colorMode: { respectPrefersColorScheme: true, }, // Replace with your project's social card image: 'img/docusaurus-social-card.jpg', navbar: { title: 'XR Blocks', logo: { alt: 'XR Blocks Logo', src: 'img/logo.svg', }, items: [ { type: 'docSidebar', sidebarId: 'tutorialSidebar', position: 'left', label: 'Manual', }, { type: 'docSidebar', sidebarId: 'typedocSidebar', position: 'left', label: 'API Reference', }, { type: 'docSidebar', sidebarId: 'templatesSidebar', position: 'left', label: 'Templates', }, { type: 'docSidebar', sidebarId: 'samplesSidebar', position: 'left', label: 'Samples', }, { href: 'https://github.com/google/xrblocks', label: 'GitHub', position: 'right', }, ], }, prism: { theme: prismThemes.github, darkTheme: prismThemes.dracula, }, algolia: { appId: 'WRVGZCGOJP', apiKey: '40150cc2c638b09de8ebbfefd50b80a4', indexName: 'XR Blocks Docs Crawler', contextualSearch: true, // Optional: Replace parts of the item URLs from Algolia. Useful when // using the same search index for multiple deployments using a different // baseUrl. You can use regexp or string in the `from` param. For example: // localhost:3000 vs myCompany.com/docs replaceSearchResultPathname: { from: '/docs/', // or as RegExp: /\/docs\// to: '/', }, // Optional: path for search page that enabled by default (`false` to // disable it) searchPagePath: 'search', }, } satisfies Preset.ThemeConfig, markdown: {format: 'detect', hooks: {onBrokenMarkdownLinks: 'warn'}}, plugins: [ [ 'docusaurus-plugin-typedoc', { sidebar: {typescript: true}, watch: process.env.TYPEDOC_WATCH?.toLowerCase() == 'true', }, ], ], }; export default config;