Skip to content

Commit 22bf32e

Browse files
committed
feat: 介绍-api-新特性-运营规范调整
1 parent 4625b35 commit 22bf32e

File tree

179 files changed

+9659
-817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+9659
-817
lines changed

docs/.vuepress/config.js

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// 注意:需要在dev前初始化内网api文档
22
const apiConfig = require('../develop/api/config');
3+
const apiConfig231017 = require('../develop/api-231017/config');
34
const nodesdkConfig = require('../develop/nodesdk/config');
45
const pythonsdkConfig = require('../develop/pythonsdk/config');
56
const gosdkConfig = require('../develop/gosdk/config');
@@ -77,7 +78,7 @@ module.exports = ctx => ({
7778
[
7879
'vuepress-plugin-right-anchor',
7980
{
80-
showDepth: 1,
81+
showDepth: 6,
8182
expand: {
8283
trigger: 'hover',
8384
clickModeDefaultOpen: true,
@@ -110,6 +111,7 @@ module.exports = ctx => ({
110111
globalUIComponents: ['TuXiaoChao','Qrcode'],
111112
theme: require.resolve('./theme-qq'),
112113
themeConfig: {
114+
// sidebarDepth: 0,
113115
sidebarDepth: 1,
114116
displayAllHeaders: false,
115117
lastUpdated: '上次更新',
@@ -118,17 +120,32 @@ module.exports = ctx => ({
118120
text: '介绍',
119121
link: '/',
120122
},
121-
// {
122-
// text: 'API文档',
123-
// link: '/develop/api/',
124-
// },
125-
apiConfig.nav,
123+
{
124+
text: 'API文档',
125+
link: '/develop/api-231017/',
126+
items: [
127+
apiConfig231017.nav,
128+
{
129+
text: 'API文档(旧版)',
130+
link: '/develop/api/'
131+
}
132+
]
133+
},
126134
{
127135
text: 'SDK文档',
128136
items: [
129-
nodesdkConfig.nav,
130-
pythonsdkConfig.nav,
131-
gosdkConfig.nav,
137+
{
138+
text: 'NodeSDK',
139+
link: 'https://github.com/tencent-connect/bot-node-sdk',
140+
},
141+
{
142+
text: 'PythonSDK',
143+
link: 'https://github.com/tencent-connect/botpy',
144+
},
145+
{
146+
text: 'GoSDK',
147+
link: 'https://github.com/tencent-connect/botgo',
148+
},
132149
],
133150
},
134151
{
@@ -158,6 +175,7 @@ module.exports = ctx => ({
158175
docsBranch: 'main',
159176
sidebar: {
160177
// '/develop/api/': convertSummary('./docs/develop/api/SUMMARY-PUBLIC.md', hiddenApi, 1, true),
178+
...apiConfig231017.sidebar,
161179
...apiConfig.sidebar,
162180
...nodesdkConfig.sidebar,
163181
...pythonsdkConfig.sidebar,

docs/.vuepress/enhanceApp.js

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
1-
import Element from 'element-ui';
2-
import 'element-ui/lib/theme-chalk/index.css';
3-
const commonConfig = require('./common');
4-
5-
export default ({ Vue, options, router, siteData, isServer }) => {
6-
Vue.use(Element);
7-
const isProd = process.env.NODE_ENV === 'production';
8-
Vue.prototype.$withBotBase = function (path) {
9-
if (path.charAt(0) === '/') {
10-
path = path.slice(1);
11-
}
12-
return (isProd ? commonConfig.cdnBase + commonConfig.cdnPath : siteData.base) + path;
13-
};
14-
};
1+
import Element from 'element-ui';
2+
import 'element-ui/lib/theme-chalk/index.css';
3+
const commonConfig = require('./common');
4+
5+
export default ({ Vue, options, router, siteData, isServer }) => {
6+
Vue.use(Element);
7+
const isProd = process.env.NODE_ENV === 'production';
8+
// 中文跳转转码且英文大写转小写(元素的 ID 属性值是小写字母)
9+
Vue.mixin({
10+
methods: {
11+
hashChange () {
12+
router.onReady(() => {
13+
setTimeout(() => {
14+
const { hash } = document.location;
15+
if (hash.length > 1) {
16+
const id = decodeURIComponent(hash.substring(1)).replace(/[A-Z]/g, (match) => {
17+
return String.fromCharCode(match.charCodeAt(0) + 32)
18+
});
19+
const element = document.getElementById(id);
20+
if (element) element.scrollIntoView();
21+
}
22+
}, 500);
23+
});
24+
}
25+
},
26+
mounted () {
27+
this.hashChange();
28+
window.addEventListener('hashchange', () => this.hashChange());
29+
}
30+
});
31+
32+
Vue.prototype.$withBotBase = function (path) {
33+
if (path.charAt(0) === '/') {
34+
path = path.slice(1);
35+
}
36+
return (isProd ? commonConfig.cdnBase + commonConfig.cdnPath : siteData.base) + path;
37+
};
38+
};
106 KB
137 KB
277 KB
Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)