1
0
Fork 0
docsearch/packages/website/docusaurus.config.mjs
Dylan Tientcheu 4f68ebbc06
feat(docusaurus-adapter): support docsearch key and adapter docs (#2858)
* feat(docusaurus-adapter): Support docsearch key and adapter docs

* chore(release): include docusaurus adapter in shipjs publish list

* chore(docusaurus-adapter): remove libtmp and pin initial version


* fix: issue with footer

* fix: contextuals

* fix all ts errors

* fix: lint

* fix lint
2026-02-17 17:53:12 +01:00

227 lines
6.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { themes } from 'prism-react-renderer';
import myLoaders from './plugins/my-loaders.mjs';
import tailwindLoader from './plugins/tailwind-loader.mjs';
const SIGNUP_LINK =
'https://dashboard.algolia.com/users/sign_up?selected_plan=docsearch&utm_source=docsearch.algolia.com&utm_medium=referral&utm_campaign=docsearch&utm_content=apply';
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
// @ts-check
// With JSDoc @type annotations, IDEs can provide config autocompletion
/** @type {import('@docusaurus/types').Config} */
export default {
title: 'DocSearch by Algolia',
tagline: 'The best search experience for docs, integrated in minutes, for free.',
url: 'https://docsearch.algolia.com',
baseUrl: '/',
favicon: 'img/favicon.ico',
organizationName: 'Algolia',
projectName: 'DocSearch',
onBrokenLinks: 'throw',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'throw',
},
},
future: {
v4: {
removeLegacyPostBuildHeadAttribute: true,
useCssCascadeLayers: false,
},
},
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: 'docs',
sidebarPath: 'sidebars.js',
editUrl: 'https://github.com/algolia/docsearch/edit/main/packages/website/',
versions: {
current: {
label: 'Stable (v4.x)',
},
v3: {
label: 'Legacy (v3.x)',
},
legacy: {
label: 'Legacy (v1.x - v2.x)',
},
},
lastVersion: 'current',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
theme: {
customCss: './src/css/custom.css',
},
}),
],
],
plugins: [myLoaders, tailwindLoader, '@docsearch/docusaurus-adapter'],
themeConfig:
/** @type {import('@docsearch/docusaurus-adapter').ThemeConfig} */
({
docsearch: {
placeholder: 'Search or ask AI',
appId: 'PMZUYBQDAK',
apiKey: '24b09689d5b4223813d9b8e48563c8f6',
indexName: 'docsearch',
askAi: {
indexName: 'docsearch-markdown',
assistantId: 'askAIDemo',
apiKey: '24b09689d5b4223813d9b8e48563c8f6',
appId: 'PMZUYBQDAK',
sidePanel: true,
},
contextualSearch: true,
translations: {
button: {
buttonText: 'Go on, give it a search...',
},
modal: {
footer: {
poweredByText: 'Powered by',
},
},
},
},
metadata: [
{
name: 'google-site-verification',
content: '23yIHmCD_xnJb_6e3s-w7M29Kydahk-d86ObMWOrvRg',
},
],
navbar: {
hideOnScroll: true,
logo: {
alt: 'DocSearch x Algolia',
src: 'img/docsearch-x-algolia-logo-light-mode.png',
srcDark: 'img/docsearch-x-algolia-logo-dark-mode.png',
className: 'docsearch-nav-logo',
},
items: [
// left
{
label: 'Documentation',
to: 'docs/what-is-docsearch',
position: 'left',
},
{
label: 'Playground',
to: 'https://community.algolia.com/docsearch-playground/',
position: 'left',
},
{
label: 'Sign up',
to: SIGNUP_LINK,
position: 'left',
},
// right
{
type: 'docsVersionDropdown',
position: 'right',
},
{
href: 'https://github.com/algolia/docsearch',
position: 'right',
className: 'header-github-link',
},
],
},
announcementBar: {
id: 'announcement-bar',
content:
'🚀 Get Ask AI now! Turn your docs site search into an AI-powered assistant faster answers, fewer tickets, better self-serve. <a target="_blank" rel="noopener noreferrer" href="https://dashboard.algolia.com/ask-ai">Get Started Now</a>',
},
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
footer: {
links: [
{
title: 'Docs',
items: [
{
label: 'Getting Started',
to: 'docs/what-is-docsearch',
},
{
label: 'FAQ',
to: 'docs/docsearch-program',
},
{
label: 'DocSearch v3',
to: 'docs/v3/docsearch',
},
{
label: 'DocSearch v4 - Beta',
to: 'docs/docsearch',
},
],
},
{
title: 'DocSearch',
items: [
{
label: 'Sign up',
to: SIGNUP_LINK,
},
{
label: 'Issues',
to: 'https://github.com/algolia/docsearch/issues',
},
{
label: 'Privacy',
to: 'https://www.algolia.com/policies/privacy/',
},
],
},
{
title: 'Community',
items: [
{
label: 'Discord',
to: 'https://discord.com/invite/W7kYfh7FKQ',
},
],
},
{
title: 'Social',
items: [
{
label: 'GitHub',
to: 'https://github.com/algolia/docsearch',
},
{
label: 'Twitter',
to: 'https://twitter.com/docsearch_',
},
{
label: 'Algolia Blog',
to: 'https://algolia.com/blog/',
},
],
},
],
logo: {
alt: 'Algolia',
src: 'img/docsearch-x-algolia-logo-light-mode.png',
srcDark: 'img/docsearch-x-algolia-logo-dark-mode.png',
width: 200,
},
copyright: `2015-${currentYear} Built with 💙 by Algolia`,
},
image: 'img/og_image.png',
prism: {
theme: themes.github,
darkTheme: themes.dracula,
},
}),
};