diff --git a/docusaurus.config.ts b/docusaurus.config.ts index f95b8c9772..9f509fab95 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -24,7 +24,34 @@ const config: Config = { defaultLocale: 'en', locales: ['en'], }, - + scripts: [ + // kapa.ai script + { + src: 'https://widget.kapa.ai/kapa-widget.bundle.js', + defer: true, + 'data-website-id': '1b51bb03-43cc-4ef4-95f1-93288a91b560', + 'data-project-name': 'Prisma', + 'data-project-color': '#2D3748', + 'data-project-logo': 'https://www.prisma.io/docs/ai_logo.png', + 'data-button-text': 'Ask AI', + 'data-modal-example-questions': + "How can I setup relations in my schema file?,What is the difference between the 'migrate dev' and 'db push' commands?,Which cache strategy should I use for my query with Prisma Accelerate?,How can I subscribe to database events with Prisma Pulse?", + 'data-button-image': 'https://www.prisma.io/docs/ai_button.svg', + 'data-button-text-color': '#71E8DF', + 'data-button-bg-color': '#2D3748', + 'data-button-border': '2px', + 'data-button-border-color': '#71e8df', + 'data-button-border-style': 'solid', + 'data-button-box-shadow': + 'drop-shadow(0px 0.724px 1.251px rgba(14, 18, 28, 0.02)) drop-shadow(0px 1.608px 2.909px rgba(14, 18, 28, 0.04)) drop-shadow(0px 2.793px 5.225px rgba(14, 18, 28, 0.06)) drop-shadow(0px 4.55px 8.671px rgba(14, 18, 28, 0.07)) drop-shadow(0px 7.485px 14.285px rgba(14, 18, 28, 0.08)) drop-shadow(0px 13.358px 24.966px rgba(14, 18, 28, 0.09)) drop-shadow(0px 33px 54px rgba(14, 18, 28, 0.07))', + }, + // OneTrust Cookies Consent Notice start for prisma.io + { + src: 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js', + 'data-document-language': 'true', + 'data-domain-script': '22c2e2c0-3df0-4958-8672-1194370ee230', + }, + ], presets: [ [ 'classic', diff --git a/sidebars.ts b/sidebars.ts index 82247f6402..d822979d1f 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -1,5 +1,36 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; +// workaround suggested by Docusaurus team: https://github.com/facebook/docusaurus/issues/9902#issuecomment-1972125804 +type SidebarConfig = SidebarsConfig[string]; +type OnlyArray = Type extends unknown[] ? Type : never; +type SidebarItemConfigArray = OnlyArray; +type SidebarItemConfig = SidebarItemConfigArray[number]; + +const platformCategory: SidebarItemConfig = { + type: 'category', + label: 'Platform', + collapsed: false, + collapsible: false, + items: [ + 'platform/index', + 'platform/about', + { + type: 'category', + label: 'Concepts', + collapsed: false, + items: [{ type: 'autogenerated', dirName: '500-platform/20-concepts' }] + }, + 'platform/maturity-levels', + 'platform/limits', + 'platform/support', + { + type: 'category', + label: 'Platform CLI', + items: [{ type: 'autogenerated', dirName: '500-platform/60-platform-cli' }], + }, + ], +}; + /** * Creating a sidebar enables you to: - create an ordered group of docs @@ -14,17 +45,17 @@ const sidebars: SidebarsConfig = { // By default, Docusaurus generates a sidebar from the docs folder structure index: ['index'], gettingStarted: [ - { - type: "category", + { + type: 'category', collapsed: false, collapsible: false, - label: "Get Started", + label: 'Get Started', items: [ - "getting-started/index", - "getting-started/quickstart", + 'getting-started/index', + 'getting-started/quickstart', { - type: "category", - label: "Set up Prisma ORM", + type: 'category', + label: 'Set up Prisma ORM', collapsed: false, items: [{ type: 'autogenerated', @@ -35,131 +66,96 @@ const sidebars: SidebarsConfig = { } ], ormSidebar: [{ - type: "category", - label: "ORM", + type: 'category', + label: 'ORM', collapsed: false, collapsible: false, items: [ - 'orm/orm-index', - { - type: "category", - label: "Overview", - collapsed: false, - items : [{ - type: 'autogenerated', - dirName: '200-orm/050-overview', - }] - }, - { - type: "category", - label: "Prisma Schema", - collapsed: false, - items : [{ - type: 'autogenerated', - dirName: '200-orm/100-prisma-schema' - }] - }, - { - type: "category", - label: "Prisma Client", - collapsed: false, - items : [{ - type: 'autogenerated', - dirName: '200-orm/200-prisma-client' - }] - }, - { - type: "category", - label: "Prisma Migrate", - collapsed: false, - items : [{ - type: 'autogenerated', - dirName: '200-orm/300-prisma-migrate' - }] - }, - { - type: "category", - label: "Tools", - collapsed: false, - items : [{ - type: 'autogenerated', - dirName: '200-orm/400-tools' - }] - }, - { - type: "category", - label: "Reference", - collapsed: false, - items : [{ - type: 'autogenerated', - dirName: '200-orm/500-reference' - }] - }, - { - type: "category", - label: "More", - collapsed: false, - items : [{ - type: 'autogenerated', - dirName: '200-orm/800-more' - }] - } - ]}], + 'orm/orm-index', + { + type: 'category', + label: 'Overview', + collapsed: false, + items: [{ + type: 'autogenerated', + dirName: '200-orm/050-overview', + }] + }, + { + type: 'category', + label: 'Prisma Schema', + collapsed: false, + items: [{ + type: 'autogenerated', + dirName: '200-orm/100-prisma-schema' + }] + }, + { + type: 'category', + label: 'Prisma Client', + collapsed: false, + items: [{ + type: 'autogenerated', + dirName: '200-orm/200-prisma-client' + }] + }, + { + type: 'category', + label: 'Prisma Migrate', + collapsed: false, + items: [{ + type: 'autogenerated', + dirName: '200-orm/300-prisma-migrate' + }] + }, + { + type: 'category', + label: 'Tools', + collapsed: false, + items: [{ + type: 'autogenerated', + dirName: '200-orm/400-tools' + }] + }, + { + type: 'category', + label: 'Reference', + collapsed: false, + items: [{ + type: 'autogenerated', + dirName: '200-orm/500-reference' + }] + }, + { + type: 'category', + label: 'More', + collapsed: false, + items: [{ + type: 'autogenerated', + dirName: '200-orm/800-more' + }] + } + ] + }], accelerateSidebar: [ { - type: "category", - label: "Accelerate", + type: 'category', + label: 'Accelerate', collapsed: false, collapsible: false, - items: [{ type: 'autogenerated', dirName: '300-accelerate'}] + items: [{ type: 'autogenerated', dirName: '300-accelerate' }] }, - { - type: "category", - label: "Platform", - collapsed: false, - collapsible: false, - items: [ - 'platform/about', - 'platform/maturity-levels', - 'platform/limits', - 'platform/support', - 'platform/index', - { - type: "category", - collapsed: false, - label: "Concepts", - items: [{ type: 'autogenerated', dirName: '500-platform/20-concepts'}] - } - ] - } + platformCategory, ], - pulseSidebar: [ + pulseSidebar: [ { - type: "category", - label: "Pulse", + type: 'category', + label: 'Pulse', collapsible: false, collapsed: false, - items: [{ type: 'autogenerated', dirName: '400-pulse'}] + items: [{ type: 'autogenerated', dirName: '400-pulse' }] }, - { - type: "category", - label: "Platform", - collapsible: false, - collapsed: false, - items: [ - 'platform/about', - 'platform/maturity-levels', - 'platform/limits', - 'platform/support', - 'platform/index', - { - type: "category", - collapsed: false, - label: "Concepts", - items: [{ type: 'autogenerated', dirName: '500-platform/20-concepts'}] - } - ] - } + platformCategory, ], aboutSidebar: [{ type: 'autogenerated',