Skip to content

Commit

Permalink
(feat): 私有部署分支文档初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
shanjingheng committed Sep 11, 2023
1 parent 29ce909 commit 0ec0194
Show file tree
Hide file tree
Showing 610 changed files with 70,552 additions and 487 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: note build
# 触发workflow的条件
on:
push:
branches: ["doc-v2"]
branches: ["privatization"]

env:
SERVER_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }} # 服务器私钥
Expand Down Expand Up @@ -62,12 +62,4 @@ jobs:
REMOTE_HOST: ${{ secrets.SERVER_HOST }}
REMOTE_PORT: ${{ secrets.SERVER_PORT }} -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa
REMOTE_USER: ${{ secrets.SERVER_USER_NAME }}
TARGET: /data/apps/data/docs-im-beta/ # 服务器目标路径

- name: CDN Refresh
uses: visionwx/ali-cdn-refresh@main
with:
accessKeyId: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_ID }}
accessKeySecret: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_SECRET }}
type: Directory
path: https://docs-im-beta.easemob.com/\r\nhttp://docs-im-beta.easemob.com/
TARGET: /data/apps/data/docs-im-privatization/ # 服务器目标路径
2 changes: 1 addition & 1 deletion docs/.vuepress/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
import { useRouter } from 'vue-router'
const router = useRouter()
router.push('/product/introduction')
router.push('/document/v2/privatization/uc_deploy')
</script>
41 changes: 25 additions & 16 deletions docs/.vuepress/components/PlatformSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { ref, watch, computed } from 'vue'
import { useRoute, useRouter} from 'vue-router'
const PLATFORM_ICON_MAP = {
privatization: {
icon : '/icon-server-dark.png',
activeIcon: '/icon-server-light.png',
},
android: {
icon : '/icon-Android.svg',
activeIcon: '/icon-Android-hover.svg',
Expand Down Expand Up @@ -43,34 +47,49 @@ const PLATFORM_ICON_MAP = {
}
const platform = ref('android')
let version = ''
const platformIcon = computed(() => PLATFORM_ICON_MAP[platform.value]?.activeIcon)
const route = useRoute()
const router = useRouter()
watch(()=>route.path, ()=> {
if (route.path.indexOf('/document') == 0) {
platform.value = route.path.split('/')[2]
version = route.path.split('/')[2]
platform.value = route.path.split('/')[3]
}
}, {immediate:true})
// 切换平台,如果有相同路径的route就直接跳转
const onChange = (platform) => {
const nextPlatformDocRouters = router.options.routes.filter(item=>item.hasOwnProperty('name') && item?.path.indexOf('/document/'+platform) == 0).map(item=>item.path)
if (platform === 'privatization') {
router.push(`/document/${version}/privatization/uc_deploy.html`)
return
}
const nextPlatformDocRouters = router.options.routes.filter(item=>item.hasOwnProperty('name') && item?.path.indexOf(`/document/${version}/${platform}`) == 0).map(item=>item.path)
let newPath = route.path.split('/')
newPath[2] = platform
newPath[3] = platform
const nextPathPath = newPath.join('/')
if (nextPlatformDocRouters.indexOf(nextPathPath) > -1) {
router.push(nextPathPath)
} else {
router.push('/document/'+platform+'/overview.html')
router.push(`/document/${version}/${platform}/overview.html`)
}
}
const options = [
{
label: '平台',
label: '安装部署',
options: [
{
value: 'privatization',
label: '服务部署',
},
],
},
{
label: '集成文档',
options: [
{
value: 'android',
Expand All @@ -88,12 +107,7 @@ const options = [
value: 'windows',
label: 'Windows',
},
],
},
{
label: '框架',
options: [
{
{
value: 'react-native',
label: 'React Native',
},
Expand All @@ -109,11 +123,6 @@ const options = [
value: 'applet',
label: '小程序',
},
],
},
{
label: '服务端',
options: [
{
value: 'server-side',
label: 'Rest Api',
Expand Down
8 changes: 4 additions & 4 deletions docs/.vuepress/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
const pageData = usePageData()
const showPlatformSwitch = ref(false)
const showPrivateSwitch = ref(false)
// const showPrivateSwitch = ref(false)
watch(pageData, ()=> {
const pagePath = pageData.value.path
showPrivateSwitch.value = pagePath.indexOf('/private/') == 0
// showPrivateSwitch.value = pagePath.indexOf('/private/') == 0
showPlatformSwitch.value = pagePath.indexOf('/document/') == 0
}, {immediate:true})
Expand All @@ -24,11 +24,11 @@
<PlatformSwitch />
</ClientOnly>
</div>
<div v-show="showPrivateSwitch" class="platform-switch">
<!-- <div v-show="showPrivateSwitch" class="platform-switch">
<ClientOnly>
<PrivateSwitch />
</ClientOnly>
</div>
</div> -->
</template>
</Sidebar>
</template>
Expand Down
95 changes: 46 additions & 49 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import path from "node:path"
export default defineUserConfig({
base: "/",
lang: "zh-CN",
title: "环信 IM 文档",
title: "环信私有化文档",
head: [
['link', { rel: 'icon', href: '/logo.png' }]
],
description: "环信 IM 文档",
description: "环信私有化文档",
bundler: viteBundler({
viteOptions: {
resolve: {
Expand Down Expand Up @@ -48,53 +48,50 @@ export default defineUserConfig({
templateBuild: path.resolve(__dirname, './templates/index.build.html'),
theme,
plugins: [
docsearchPlugin({
appId: '5K8UTB3JVE',
apiKey: 'df9e938d06f6531ce8dd8de71f907f0d',
indexName: 'im-beta-easemob',
// transformItems: (items)=>{
// return items.map(items=>({ ...items, content: 'xxxxx'}))
// },
placeholder: '搜索文档',
translations: {
button: {
buttonText: '搜索',
buttonAriaLabel: '搜索文档',
},
modal: {
searchBox: {
resetButtonTitle: '清除查询条件',
resetButtonAriaLabel: '清除查询条件',
cancelButtonText: '取消',
cancelButtonAriaLabel: '取消',
},
startScreen: {
recentSearchesTitle: '搜索历史',
noRecentSearchesText: '没有搜索历史',
saveRecentSearchButtonTitle: '保存至搜索历史',
removeRecentSearchButtonTitle: '从搜索历史中移除',
favoriteSearchesTitle: '收藏',
removeFavoriteSearchButtonTitle: '从收藏中移除',
},
errorScreen: {
titleText: '无法获取结果',
helpText: '你可能需要检查你的网络连接',
},
footer: {
selectText: '选择',
navigateText: '切换',
closeText: '关闭',
searchByText: '搜索提供者',
},
noResultsScreen: {
noResultsText: '无法找到相关结果',
suggestedQueryText: '你可以尝试查询',
reportMissingResultsText: '你认为该查询应该有结果?',
reportMissingResultsLinkText: '点击反馈',
},
},
}
}),
// docsearchPlugin({
// appId: '5K8UTB3JVE',
// apiKey: 'df9e938d06f6531ce8dd8de71f907f0d',
// indexName: 'im-beta-easemob',
// placeholder: '搜索文档',
// translations: {
// button: {
// buttonText: '搜索',
// buttonAriaLabel: '搜索文档',
// },
// modal: {
// searchBox: {
// resetButtonTitle: '清除查询条件',
// resetButtonAriaLabel: '清除查询条件',
// cancelButtonText: '取消',
// cancelButtonAriaLabel: '取消',
// },
// startScreen: {
// recentSearchesTitle: '搜索历史',
// noRecentSearchesText: '没有搜索历史',
// saveRecentSearchButtonTitle: '保存至搜索历史',
// removeRecentSearchButtonTitle: '从搜索历史中移除',
// favoriteSearchesTitle: '收藏',
// removeFavoriteSearchButtonTitle: '从收藏中移除',
// },
// errorScreen: {
// titleText: '无法获取结果',
// helpText: '你可能需要检查你的网络连接',
// },
// footer: {
// selectText: '选择',
// navigateText: '切换',
// closeText: '关闭',
// searchByText: '搜索提供者',
// },
// noResultsScreen: {
// noResultsText: '无法找到相关结果',
// suggestedQueryText: '你可以尝试查询',
// reportMissingResultsText: '你认为该查询应该有结果?',
// reportMissingResultsLinkText: '点击反馈',
// },
// },
// }
// }),
],
onPrepared: async (app) => {
await app.writeTemp(
Expand Down
Loading

0 comments on commit 0ec0194

Please sign in to comment.