Skip to content

Commit 901c754

Browse files
feat: ✨ 引入 vitepress-plugin-llms 优化 AI 理解 (#1034)
1 parent 588baeb commit 901c754

5 files changed

Lines changed: 1368 additions & 562 deletions

File tree

components.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export {}
77

88
declare module 'vue' {
99
export interface GlobalComponents {
10-
ConditionalTest: typeof import('./src/components/conditional-test.vue')['default']
1110
DemoBlock: typeof import('./src/components/demo-block/demo-block.vue')['default']
1211
PageWraper: typeof import('./src/components/page-wraper/page-wraper.vue')['default']
1312
WdPrivacyPopup: typeof import('./src/components/wd-privacy-popup/wd-privacy-popup.vue')['default']

docs/.vitepress/config.mts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
/*
22
* @Author: weisheng
33
* @Date: 2023-07-27 10:26:09
4-
* @LastEditTime: 2025-03-29 15:02:23
4+
* @LastEditTime: 2025-05-06 15:18:36
55
* @LastEditors: weisheng
6-
* @Description:
6+
* @Description:
77
* @FilePath: /wot-design-uni/docs/.vitepress/config.mts
88
* 记得注释
99
*/
1010
import { defineConfig } from 'vitepress';
1111
import viteCompression from 'vite-plugin-compression'
1212
import { fileURLToPath, URL } from 'node:url'
1313
import { MarkdownTransform } from './plugins/markdown-transform'
14+
import llmstxt from 'vitepress-plugin-llms'
1415
import enUS from './locales/en-US'
1516
import zhCN from './locales/zh-CN'
16-
17-
1817
export default defineConfig({
1918
vite: {
2019
plugins: [
20+
llmstxt({
21+
ignoreFiles: ['reward/*', 'index.md', 'README.md', 'en-US/*.md', 'en-US/**/*.md', 'ads/*', 'guide/cases.md', 'guide/changelog.md', 'guide/join-group.md', 'guide/typography.md'],
22+
domain: 'https://wot-design-uni.cn',
23+
}),
2124
MarkdownTransform(),
2225
viteCompression({
2326
verbose: true,
2427
disable: false,
2528
threshold: 10240,
2629
algorithm: 'gzip',
2730
ext: '.gz',
28-
})
31+
}),
2932
],
3033
ssr: { noExternal: ['element-plus'] },
3134
resolve: {
@@ -72,20 +75,20 @@ export default defineConfig({
7275
...zhCN
7376
},
7477
'en-US': {
75-
label: 'English',
78+
label: 'English',
7679
lang: 'en-US',
7780
...enUS,
7881
}
7982
},
8083
head: [
8184
['link', { rel: 'icon', href: '/favicon.ico' }],
8285
['link', { rel: 'stylesheet', href: '/petercatai/assistant.min.css' }],
83-
['script', {src: '/petercatai/react.development.js' }],
84-
['script', {src: '/petercatai/react-dom.development.js' }],
85-
['script', {src: '/petercatai/dayjs.min.js' }],
86-
['script', {src: '/petercatai/antd.js' }],
87-
['script', {src: '/petercatai/lottie.js' }],
88-
['script', {src: '/petercatai/assistant.min.js' }],
86+
['script', { src: '/petercatai/react.development.js' }],
87+
['script', { src: '/petercatai/react-dom.development.js' }],
88+
['script', { src: '/petercatai/dayjs.min.js' }],
89+
['script', { src: '/petercatai/antd.js' }],
90+
['script', { src: '/petercatai/lottie.js' }],
91+
['script', { src: '/petercatai/assistant.min.js' }],
8992
['script', {}, `
9093
!function(p){"use strict";!function(t){var s=window,e=document,i=p,c="".concat("https:"===e.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),n=e.createElement("script"),r=e.getElementsByTagName("script")[0];n.type="text/javascript",n.setAttribute("charset","UTF-8"),n.async=!0,n.src=c,n.id="LA_COLLECT",i.d=n;var o=function(){s.LA.ids.push(i)};s.LA?s.LA.ids&&o():(s.LA=p,s.LA.ids=[],o()),r.parentNode.insertBefore(n,r)}()}({id:"3J4q4tM6fN0n1fbZ",ck:"3J4q4tM6fN0n1fbZ"});
9194
`],
@@ -152,10 +155,10 @@ export default defineConfig({
152155
}, {
153156
text: '更新日志',
154157
link: '/guide/changelog',
155-
},{
158+
}, {
156159
text: '⭐ 案例',
157160
link: '/guide/cases',
158-
},{
161+
}, {
159162
text: '加群沟通',
160163
link: '/guide/join-group',
161164
}
@@ -219,10 +222,10 @@ export default defineConfig({
219222
{
220223
text: '更新日志',
221224
link: '/guide/changelog',
222-
},{
225+
}, {
223226
text: '⭐ 案例',
224227
link: '/guide/cases',
225-
},{
228+
}, {
226229
text: '加群沟通',
227230
link: '/guide/join-group',
228231
}
@@ -369,12 +372,10 @@ export default defineConfig({
369372
}, {
370373
link: "/component/password-input",
371374
text: "PasswordInput 密码输入框"
372-
},
373-
, {
375+
}, {
374376
link: "/component/signature",
375377
text: "Signature 签名"
376-
}
377-
]
378+
}]
378379
}, {
379380
text: "反馈",
380381
collapsed: false,
@@ -436,7 +437,7 @@ export default defineConfig({
436437
link: "/component/number-keyboard",
437438
text: "NumberKeyboard 数字键盘"
438439
}]
439-
},
440+
},
440441
{
441442
text: "数据展示",
442443
collapsed: false,

docs/public/_redirects

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/llms-full.md /llms-full.txt 200!
2+
/llms-full.txt /llms-full.txt 200!
3+
/llms.md /llms.txt 200!
4+
/llms.txt /llms.txt 200!

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"@dcloudio/uni-quickapp-webview": "3.0.0-4050720250324001",
8787
"element-plus": "^2.3.9",
8888
"vite-plugin-compression": "^0.5.1",
89+
"vitepress": "^1.6.3",
8990
"vue": "^3.4.38",
9091
"vue-i18n": "9.1.9"
9192
},
@@ -146,8 +147,8 @@
146147
"uni-read-pages-vite": "^0.0.6",
147148
"unplugin-auto-import": "^0.17.5",
148149
"unplugin-vue-components": "^0.26.0",
149-
"vite": "5.2.8",
150-
"vitepress": "^1.5.0",
150+
"vite": "5",
151+
"vitepress-plugin-llms": "^1.1.3",
151152
"vitest": "^3.1.1",
152153
"vue-eslint-parser": "^9.1.0",
153154
"vue-tsc": "^2.0.29"

0 commit comments

Comments
 (0)