Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(ci): test local search instead of algolia #3683

Draft
wants to merge 17 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
node-version: 18
cache: yarn

- name: Install dependencies
Expand Down
33 changes: 10 additions & 23 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,16 @@ const config = {
],
],

themes: [],
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
({
hashed: true,
indexBlog: false,
cg-tw marked this conversation as resolved.
Show resolved Hide resolved
language: ["en", "fr"],
}),
],
],

plugins: (() => {
let plugins = [
Expand All @@ -151,19 +160,6 @@ const config = {
'plugin-image-zoom',
];

if (archivedVersion) {
plugins = [
...plugins,
[
require.resolve("@cmfcmf/docusaurus-search-local"),
{
indexBlog: false,
language: ["en", "fr"],
},
],
];
}

if (cloud) {
plugins = [
...plugins,
Expand Down Expand Up @@ -208,15 +204,6 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
algolia: archivedVersion
? undefined
: {
appId: '3WEC6XPLDB',
apiKey: 'be499306058f3e54012bab278e6e6d86',
indexName: 'centreon',
contextualSearch: true,
},

zoomSelector: '.markdown :not(.authority-availability) > img',

prism: {
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^1.1.0",
"@docusaurus/core": "^2.4.3",
"@docusaurus/plugin-content-docs": "^2.4.3",
"@docusaurus/plugin-ideal-image": "^2.4.3",
"@docusaurus/preset-classic": "^2.4.3",
"@docusaurus/theme-common": "^2.4.3",
"@easyops-cn/docusaurus-search-local": "0.35.0",
"@svgr/webpack": "^8.1.0",
"@swc/core": "^1.3.90",
"clsx": "^1.2.1",
Expand All @@ -29,6 +30,9 @@
"swc-loader": "^0.2.3",
"typeface-roboto": "^1.1.13"
},
"resolutions": {
"cheerio": "1.0.0-rc.3"
},
"browserslist": {
"production": [
">0.5%",
Expand Down
Loading