Use local search and update docusaurus (#1093)

This commit is contained in:
Anbraten 2022-08-14 09:19:24 +02:00 committed by GitHub
parent 7a4827bbf6
commit fdf5fd3f69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2070 additions and 2179 deletions

View file

@ -1,15 +1,19 @@
variables:
- &node_image 'node:16-alpine'
- &when_path
- "docs/**"
- ".woodpecker/docs.yml"
pipeline: pipeline:
build: build:
image: node:14-alpine image: *node_image
commands: commands:
- cd docs/ - cd docs/
- yarn install --frozen-lockfile - yarn install --frozen-lockfile
- yarn build - yarn build
when: when:
event: [push, pull_request] event: [push, pull_request]
path: path: *when_path
- "docs/**"
- ".woodpecker/docs.yml"
deploy-preview: deploy-preview:
image: woodpeckerci/plugin-surge-preview:next image: woodpeckerci/plugin-surge-preview:next
@ -23,9 +27,8 @@ pipeline:
from_secret: GITHUB_TOKEN_SURGE from_secret: GITHUB_TOKEN_SURGE
when: when:
event: pull_request event: pull_request
path: path: *when_path
- "docs/**"
- ".woodpecker/docs.yml"
# TODO: add step to remove preview again after PR is closed (waiting for #286) # TODO: add step to remove preview again after PR is closed (waiting for #286)
deploy: deploy:
@ -52,7 +55,4 @@ pipeline:
when: when:
event: push event: push
branch: ${CI_REPO_DEFAULT_BRANCH} branch: ${CI_REPO_DEFAULT_BRANCH}
path: path: *when_path
- "docs/**"
- ".woodpecker/docs.yml"

View file

@ -126,12 +126,6 @@ module.exports = {
backgroundColor: 'var(--ifm-color-primary)', backgroundColor: 'var(--ifm-color-primary)',
textColor: 'var(--ifm-color-gray-900)', textColor: 'var(--ifm-color-gray-900)',
}, },
algolia: {
appId: 'BH4D9OD16A',
apiKey: '148f85e216b68d20ffa49d46a2b89d0e',
indexName: 'woodpecker-ci',
debug: false, // Set debug to true if you want to inspect the modal
},
tableOfContents: { tableOfContents: {
minHeadingLevel: 2, minHeadingLevel: 2,
maxHeadingLevel: 4, maxHeadingLevel: 4,
@ -164,7 +158,15 @@ module.exports = {
}, },
}), }),
], ],
themes: [path.resolve(__dirname, 'plugins', 'woodpecker-plugins', 'dist')], themes: [
path.resolve(__dirname, 'plugins', 'woodpecker-plugins', 'dist'),
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
},
],
],
presets: [ presets: [
[ [
'@docusaurus/preset-classic', '@docusaurus/preset-classic',

View file

@ -15,14 +15,14 @@
"write-heading-ids": "docusaurus write-heading-ids" "write-heading-ids": "docusaurus write-heading-ids"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "^2.0.0-beta.18", "@docusaurus/core": "^2.0.1",
"@docusaurus/preset-classic": "^2.0.0-beta.18", "@docusaurus/preset-classic": "^2.0.1",
"@docusaurus/theme-search-algolia": "^2.0.0-beta.18", "@easyops-cn/docusaurus-search-local": "^0.31.0",
"@mdx-js/react": "^1.6.22", "@mdx-js/react": "^1.6.22",
"@svgr/webpack": "^6.2.1", "@svgr/webpack": "^6.3.1",
"clsx": "^1.1.1", "clsx": "^1.2.1",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"prism-react-renderer": "^1.3.1", "prism-react-renderer": "^1.3.5",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"url-loader": "^4.1.1" "url-loader": "^4.1.1"
@ -40,11 +40,11 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "^2.0.0-beta.18", "@docusaurus/module-type-aliases": "^2.0.1",
"@tsconfig/docusaurus": "^1.0.5", "@tsconfig/docusaurus": "^1.0.6",
"@types/react": "^17.0.43", "@types/react": "^18.0.17",
"@types/react-helmet": "^6.1.5", "@types/react-helmet": "^6.1.5",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"typescript": "^4.6.3" "typescript": "^4.7.4"
} }
} }

File diff suppressed because it is too large Load diff