Skip to content

Commit

Permalink
Merge branch 'doc-v2' into doc-v2-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
shanjingheng committed Mar 1, 2024
2 parents 8151977 + 9fdb703 commit 865b8fc
Show file tree
Hide file tree
Showing 782 changed files with 28,049 additions and 4,702 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,18 @@ jobs:
REMOTE_USER: ${{ secrets.SERVER_USER_NAME }}
TARGET: /data/apps/data/docs-im-beta/ # 服务器目标路径

- name: CDN Refresh
- name: CDN Refresh HTTPS
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/
path: https://doc.easemob.com/

- name: CDN Refresh HTTP
uses: visionwx/ali-cdn-refresh@main
with:
accessKeyId: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_ID }}
accessKeySecret: ${{ secrets.ALIYUN_CDN_ACCESS_KEY_SECRET }}
type: Directory
path: http://doc.easemob.com/
113 changes: 107 additions & 6 deletions docs/.vuepress/components/HomePage.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,112 @@
<template>
<div>
</div>
<HopeHomePage>
<template #center>
<div class="feature-panel">
<div class="feature-wrapper">
<div
class="feature-item"
v-for="product in products"
:key="product.title"
>
<h3>{{ product.title }}</h3>
<div class="feature-link-wrapper">
<a
v-for="link in product.links"
:key="link.link"
class="feature-link-item"
:href="link.link"
>
<img
width="20"
height="20"
v-if="link.icon"
:src="link.icon"
alt="Platform"
/>
<span v-if="link.text"> {{ link.text }} </span>
</a>
</div>
</div>
</div>

<div class="feature-wrapper">
<div
v-for="project in projects"
:key="project.title"
class="feature-item"
style="flex-basis: 100%"
>
<h3>{{ project.title }}</h3>
<p v-if="project.desc">{{ project.desc }}</p>
<template v-for="info in project.info" :key="info.link">
<h4 v-if="info.name">{{ info.name }}</h4>
<div class="feature-link-wrapper">
<a
v-for="link in info.links"
:key="link.text"
class="feature-link-item"
:href="link.link"
>
<img
width="20"
height="20"
v-if="link.icon"
:src="link.icon"
alt="Platform"
/>
<span v-if="link.text"> {{ link.text }} </span>
</a>
</div>
</template>
</div>
</div>
</div>
</template>
</HopeHomePage>
</template>
<script setup lang="ts">
// import HopeHomePage from "vuepress-theme-hope/components/HomePage.js";
import { useRouter } from 'vue-router'
import HopeHomePage from "vuepress-theme-hope/components/HomePage.js";
import Sidebar from "vuepress-theme-hope/modules/sidebar/components/Sidebar.js";
import { usePageFrontmatter } from "@vuepress/client";
import { useRouter } from "vue-router";
const router = useRouter()
router.push('/product/introduction')
const frontmatter = usePageFrontmatter();
const products = frontmatter.value.products || [];
const projects = frontmatter.value.projects || [];
// const router = useRouter()
// router.push('/product/introduction')
</script>
<style scoped>
.home {
padding-top: var(--navbar-height);
}
.feature-wrapper {
justify-content: flex-start;
border-width: 0 0 1px 0;
border-color: var(--border-color);
border-style: solid;
}
@media screen and ((min-width: 1440px)) {
.feature-item {
flex-basis: calc(33% - 3rem);
}
}
.feature-link-wrapper {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
}
.feature-link-item {
padding: 0.5rem 1rem 0.5rem 0;
transition: color 0.2s linear;
transition: padding 0.2s linear;
}
.feature-link-item:hover {
color: var(--accent-color);
padding-top: 0.3rem;
}
</style>
16 changes: 16 additions & 0 deletions docs/.vuepress/components/PlatformSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ const PLATFORM_ICON_MAP = {
icon : '/icon-platform.svg',
activeIcon: '/icon-platform-hover.svg',
},
electron: {
icon : '/icon-Electron.svg',
activeIcon: '/icon-Electron-hover.svg',
},
linux: {
icon : '/icon-linux.svg',
activeIcon: '/icon-linux-hover.svg',
},
}
const platform = ref('android')
Expand Down Expand Up @@ -88,6 +96,10 @@ const options = [
value: 'windows',
label: 'Windows',
},
{
value: 'linux',
label: 'Linux',
},
],
},
{
Expand All @@ -109,6 +121,10 @@ const options = [
value: 'applet',
label: '小程序',
},
{
value: 'electron',
label: 'Electron',
},
],
},
{
Expand Down
81 changes: 39 additions & 42 deletions docs/.vuepress/components/UIKitSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,6 @@ const PLATFORM_ICON_MAP = {
},
}
const platform = ref('android')
const platformIcon = computed(() => PLATFORM_ICON_MAP[platform.value]?.activeIcon)
const route = useRoute()
const router = useRouter()
watch(()=>route.path, ()=> {
if (route.path.indexOf('/uikit') == 0) {
platform.value = route.path.split('/')[2]
}
}, {immediate:true})
// 切换平台,如果有相同路径的route就直接跳转
const onChange = (platform) => {
const nextPlatformDocRouters = router.options.routes.filter(item=>item.hasOwnProperty('name') && item?.path.indexOf('/uikit/'+platform) == 0).map(item=>item.path)
let newPath = route.path.split('/')
newPath[2] = platform
const nextPathPath = newPath.join('/')
if (nextPlatformDocRouters.indexOf(nextPathPath) > -1) {
router.push(nextPathPath)
} else {
router.push('/uikit/'+platform+'/overview.html')
}
}
const options = [
{
label: '平台',
Expand All @@ -80,14 +54,10 @@ const options = [
value: 'ios',
label: 'iOS',
},
// {
// value: 'web',
// label: 'Web',
// },
// {
// value: 'windows',
// label: 'Windows',
// },
{
value: 'web',
label: 'Web',
},
],
},
{
Expand All @@ -101,17 +71,44 @@ const options = [
value: 'flutter',
label: 'Flutter',
},
// {
// value: 'unity',
// label: 'Unity',
// },
// {
// value: 'applet',
// label: '小程序',
// },
],
},
]
const platform = ref('android')
const kitType = ref('chatuikit')
const platformIcon = computed(() => PLATFORM_ICON_MAP[platform.value]?.activeIcon)
const route = useRoute()
const router = useRouter()
watch(()=>route.path, ()=> {
if (route.path.indexOf('/uikit') == 0) {
const splitRoute = route.path.split('/')
kitType.value = splitRoute[2]
platform.value = splitRoute[3]
}
}, {immediate:true})
// 切换平台,如果有相同路径的route就直接跳转
const onChange = (platform) => {
const nextPlatformDocRouters = router.options.routes.filter(item=>item.hasOwnProperty('name') &&
item?.path.indexOf(`/uikit/${kitType.value}/${platform}`) == 0).map(item=>item.path)
let newPath = route.path.split('/')
newPath[3] = platform
const nextPathPath = newPath.join('/')
if (nextPlatformDocRouters.indexOf(nextPathPath) > -1) {
router.push(nextPathPath)
} else {
if (kitType.value == 'chatuikit') {
router.push(`/uikit/${kitType.value}/${platform}/overview.html`)
}
if (kitType.value == 'chatroomuikit') {
router.push(`/uikit/${kitType.value}/${platform}/roomuikit_overview.html`)
}
}
}
</script>


Expand Down
Loading

0 comments on commit 865b8fc

Please sign in to comment.