Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
jiazengp committed Aug 25, 2023
1 parent b81f76d commit 1f90c4a
Show file tree
Hide file tree
Showing 22 changed files with 331 additions and 878 deletions.
5 changes: 2 additions & 3 deletions .vitepress/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const enConfig: LocaleSpecificConfig<
next: 'Next page',
},
editLink: {
pattern: 'https://github.com/kongying-tavern/docs/edit/next/src/:path',
pattern: 'https://github.com/kongying-tavern/docs/edit/main/src/:path',
text: 'Suggest changes to this page',
},
payment: {
Expand Down Expand Up @@ -128,7 +128,7 @@ function nav(): DefaultTheme.NavItem[] {
},
{
text: 'Support',
activeMatch: `/manual/`,
activeMatch: `^/en/manual/`,
items: [
{
text: 'Client User Manual',
Expand All @@ -146,7 +146,6 @@ function nav(): DefaultTheme.NavItem[] {
},
{
text: 'About',
activeMatch: `/join|team|credits|contribution|disclaimer|agreement|friends-links|privacy|disclaimer|/`,
items: [
{
text: 'About Us',
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const frConfig: LocaleSpecificConfig<
next: 'Page suivante',
},
editLink: {
pattern: 'https://github.com/kongying-tavern/docs/edit/next/src/:path',
pattern: 'https://github.com/kongying-tavern/docs/edit/main/src/:path',
text: 'Suggérer des modifications à cette page',
},
payment: {
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const jaConfig: LocaleSpecificConfig<
},
},
editLink: {
pattern: 'https://github.com/kongying-tavern/docs/edit/next/src/:path',
pattern: 'https://github.com/kongying-tavern/docs/edit/main/src/:path',
text: 'エラー報告',
},
nav: baseHelper(nav(), LOCAL_BASE),
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const koConfig: LocaleSpecificConfig<
next: 'Next page',
},
editLink: {
pattern: 'https://github.com/kongying-tavern/docs/edit/next/src/:path',
pattern: 'https://github.com/kongying-tavern/docs/edit/main/src/:path',
text: 'Suggest changes to this page',
},
payment: {
Expand Down
4 changes: 2 additions & 2 deletions .vitepress/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const zhConfig: LocaleSpecificConfig<
},
},
editLink: {
pattern: 'https://github.com/kongying-tavern/docs/edit/next/src/:path',
pattern: 'https://github.com/kongying-tavern/docs/edit/main/src/:path',
text: '报告错误',
},
sidebar: baseHelper(sidebar(), LOCAL_BASE),
Expand Down Expand Up @@ -148,7 +148,7 @@ function nav(): DefaultTheme.NavItem[] {
},
{
text: '了解更多',
activeMatch: `^/join|team|credits|contribution|disclaimer|agreement|friends-links|privacy|disclaimer|/^`,

items: [
{
text: '了解我们',
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/theme/components/LinkGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Integration {
:class="item.icon"
class="w-10 h-10 mb2"
/>
<img v-else :src="item.icon" class="w-10 h-10 mb-2" />
<img v-else :src="item.icon" class="w-10 h-10 mb-2 no-zoomable" />
<span class="text-sm">{{ item.name }}</span>
<span class="text-xs opacity-50">{{ item.secondary }}</span>
</a>
Expand Down
52 changes: 51 additions & 1 deletion .vitepress/theme/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export function baseHelper(obj, base): any {
newObj[key] = modifyLink(obj[key])
} else if (key === 'link' && isRelativeLink(obj[key])) {
newObj[key] = base + obj[key]
if (isLinkExternal(obj[key])) newObj['target'] = '_blank'
} else {
newObj[key] = obj[key]
}
Expand All @@ -315,5 +316,54 @@ export function baseHelper(obj, base): any {
}
return newObj
}
return modifyKey(modifyLink(obj))
return modifyKey(obj)
}

/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
export function copyArray(source, array) {
let index = -1
const length = source.length

array || (array = new Array(length))
while (++index < length) {
array[index] = source[index]
}
return array
}

/**
* Creates an array of shuffled values, using a version of the
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
*
* @since 0.1.0
* @category Array
* @param {Array} array The array to shuffle.
* @returns {Array} Returns the new shuffled array.
* @example
*
* shuffle([1, 2, 3, 4])
* // => [4, 1, 3, 2]
*/
export function shuffle(array: Array<any>): Array<any> {
const length = array == null ? 0 : array.length
if (!length) {
return []
}
let index = -1
const lastIndex = length - 1
const result = copyArray(array)
while (++index < length) {
const rand = index + Math.floor(Math.random() * (lastIndex - index + 1))
const value = result[rand]
result[rand] = result[index]
result[index] = value
}
return result
}
Loading

0 comments on commit 1f90c4a

Please sign in to comment.