Skip to content

Commit

Permalink
docs: add algolia search
Browse files Browse the repository at this point in the history
  • Loading branch information
zhensherlock committed Sep 27, 2024
1 parent 10ab2f0 commit f342c5e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
33 changes: 33 additions & 0 deletions crawlerConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"index_name": "watermark-design",
"start_urls": ["https://watermark-design.github.io/watermark/"],
"rateLimit": 8,
"maxDepth": 10,
"selectors": {
"lvl0": {
"selector": "",
"defaultValue": "Documentation"
},
"lvl1": ".content h1",
"lvl2": ".content h2",
"lvl3": ".content h3",
"lvl4": ".content h4",
"lvl5": ".content h5",
"content": ".content p, .content li",
"lang": {
"selector": "/html/@lang",
"type": "xpath",
"global": true
}
},
"selectors_exclude": [
"aside",
".page-footer",
".next-and-prev-link",
".table-of-contents"
],
"custom_settings": {
"attributesForFaceting": ["lang", "tags"]
},
"js_render": true
}
10 changes: 5 additions & 5 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ export default {
},
],
},
// algolia: {
// appId: 'V6CF28P0PS',
// apiKey: '692752b7b3c6f794997d8ae22aed79fa',
// indexName: 'dev_docs'
// },
algolia: {
appId: 'V6CF28P0PS',
apiKey: '692752b7b3c6f794997d8ae22aed79fa',
indexName: 'watermark-design',
},
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2022-present Michael Sun',
Expand Down
7 changes: 7 additions & 0 deletions docs/.vitepress/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ export default {
footer: {
message: '本中文文档内容版权为 Michael Sun 所有,保留所有权利。',
},
algolia: {
appId: 'V6CF28P0PS',
apiKey: '692752b7b3c6f794997d8ae22aed79fa',
indexName: 'watermark-design',
placeholder: '请输入关键词',
buttonText: '搜索',
},
};
5 changes: 2 additions & 3 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import DefaultTheme from 'vitepress/theme';
import ElementPlus from 'element-plus';
import './custom-theme.scss';
import 'element-plus/dist/index.css';
import 'element-plus/theme-chalk/dark/css-vars.css';
Expand All @@ -7,9 +8,7 @@ export default {
enhanceApp: async ({ app, router, siteData, isServer }: any) => {
// app is the Vue 3 app instance from `createApp()`. router is VitePress'
// custom router. `siteData`` is a `ref`` of current site-level metadata.
import('element-plus').then((module) => {
app.use(module);
});
app.use(ElementPlus);
// import('@watermark-design/vue').then((module) => {
// app.use(module.default);
// });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "watermark-design",
"version": "1.0.0",
"version": "1.x",
"private": true,
"description": "watermark-design monorepo",
"workspaces": [
Expand Down

0 comments on commit f342c5e

Please sign in to comment.