Skip to content

Commit

Permalink
optimized(docs): 升级优化文档 (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
yansongda authored Sep 9, 2023
1 parent 98b101c commit 6318a1e
Show file tree
Hide file tree
Showing 29 changed files with 1,687 additions and 1,031 deletions.
9 changes: 9 additions & 0 deletions web/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
65 changes: 33 additions & 32 deletions web/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
import { defineConfig } from 'vitepress';
import nav from './nav';
import sidebar from "./sidebar";
import { defineConfig } from 'vitepress'
import nav from './config/nav'
import sidebar from "./config/sidebar"

export default defineConfig({
lang: 'zh-CN',
title: 'Pay',
description: '可能是我用过的最优雅的支付宝SDK、微信支付SDK、银联支付SDK 了; yansongda pay 让支付开发更简单',
lastUpdated: true,
head: [
['link', { rel: 'icon', href: '/images/icon.png' }]
lang: 'zh-CN',
title: 'Pay',
description: '可能是我用过的最优雅的支付宝SDK、微信支付SDK、银联支付SDK 了; yansongda pay 让支付开发更简单',
lastUpdated: true,
head: [
['link', { rel: 'icon', href: '/images/icon.png' }],
['script', { defer: '', src: 'https://static.cloudflareinsights.com/beacon.min.js', 'data-cf-beacon': "{'token': '0bff42137b6e45f0be5c8256c00cfc3a'}" }]
],
themeConfig: {
logo: '/images/logo2.png',
nav: nav,
sidebar: sidebar,
socialLinks: [
{ icon: 'github', link: 'https://github.com/yansongda/pay' },
],
themeConfig: {
logo: '/images/logo2.png',
nav: nav,
sidebar: sidebar,
socialLinks: [
{ icon: 'github', link: 'https://github.com/yansongda/pay' },
],
editLink: {
pattern: 'https://github.com/yansongda/pay/edit/master/web/:path',
text: 'Edit this page on GitHub'
},
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2017-present yansongda'
},
search: {
provider: 'algolia',
options: {
appId: 'UJ4V77W9P7',
apiKey: '181f0abb91e2400ab3c9907a4ab29532',
indexName: 'yansongda'
}
}
editLink: {
pattern: 'https://github.com/yansongda/pay/edit/master/web/:path',
text: 'Edit this page on GitHub'
},
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2017-present yansongda'
},
search: {
provider: 'algolia',
options: {
appId: 'UJ4V77W9P7',
apiKey: '181f0abb91e2400ab3c9907a4ab29532',
indexName: 'yansongda'
}
}
}
})
28 changes: 28 additions & 0 deletions web/.vitepress/config/nav.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { DefaultTheme } from "vitepress"

export default [
{ text: 'Home', link: '/' },
{
text: '版本',
items: [
{
text: '停止维护',
items: [
{ text: 'v1.x', link: '/docs/v1/', activeMatch: '^/docs/v1/' }
]
},
{
text: '安全支持',
items: [
{ text: 'v2.x', link: '/docs/v2/', activeMatch: '^/docs/v2/' }
]
},
{
text: '积极开发中',
items: [
{ text: 'v3.x', link: '/docs/v3/', activeMatch: '^/docs/v3/' }
]
}
]
}
] as DefaultTheme.NavItem[]
13 changes: 13 additions & 0 deletions web/.vitepress/config/sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import versions from '../sidebar/versions'
import { DefaultTheme } from 'vitepress'

let sidebars: DefaultTheme.Sidebar = {}

versions.forEach(async (version) => {
const path = `/docs/${version}/`

// @ts-ignore
sidebars[path] = (await import('../sidebar/v3')).default as DefaultTheme.Sidebar
});

export default sidebars
26 changes: 0 additions & 26 deletions web/.vitepress/nav.ts

This file was deleted.

15 changes: 0 additions & 15 deletions web/.vitepress/sidebar.ts

This file was deleted.

3 changes: 3 additions & 0 deletions web/.vitepress/sidebar/v1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { DefaultTheme } from 'vitepress'

export default [] as DefaultTheme.Sidebar
64 changes: 64 additions & 0 deletions web/.vitepress/sidebar/v2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { DefaultTheme } from 'vitepress'

export default [
{
text: '快速入门',
collapsed: false,
items: [
{ text: '安装', link: '/docs/v2/installation' },
{ text: '快速上手', link: '/docs/v2/quickUsage' },
{ text: '贡献', link: '/docs/v2/contribute' }
]
},
{
text: '支付 - 支付宝',
collapsed: false,
items: [
{ text: '概述', link: '/docs/v2/alipay/index' },
{ text: '支付', link: '/docs/v2/alipay/pay' },
{ text: '查询', link: '/docs/v2/alipay/find' },
{ text: '取消', link: '/docs/v2/alipay/cancel' },
{ text: '关闭', link: '/docs/v2/alipay/close' },
{ text: '退款', link: '/docs/v2/alipay/refund' },
{ text: '接收回调', link: '/docs/v2/alipay/callback' },
{ text: '确认回调', link: '/docs/v2/alipay/response' }
]
},
{
text: '支付 - 微信',
collapsed: false,
items: [
{ text: '概述', link: '/docs/v2/wechat/index' },
{ text: '支付', link: '/docs/v2/wechat/pay' },
{ text: '查询', link: '/docs/v2/wechat/find' },
{ text: '取消', link: '/docs/v2/wechat/cancel' },
{ text: '关闭', link: '/docs/v2/wechat/close' },
{ text: '退款', link: '/docs/v2/wechat/refund' },
{ text: '接收回调', link: '/docs/v2/wechat/callback' },
{ text: '确认回调', link: '/docs/v2/wechat/response' }
]
},
{
text: '事件系统',
collapsed: false,
items: [
{ text: '概述', link: '/docs/v2/events/index' },
{ text: '说明', link: '/docs/v2/events/class' },
{ text: '使用', link: '/docs/v2/events/usage' }
]
},
{
text: '日志系统',
collapsed: false,
items: [
{ text: '使用', link: '/docs/v2/logger/usage' }
]
},
{
text: '其它',
collapsed: false,
items: [
{ text: 'FAQ', link: '/docs/v2/others/faq' }
]
}
] as DefaultTheme.Sidebar
100 changes: 100 additions & 0 deletions web/.vitepress/sidebar/v3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { DefaultTheme } from 'vitepress'

export default [
{
text: '概述',
collapsed: false,
items: [
{ text: '线上交流', link: '/docs/v3/overview/communication' },
{ text: '捐赠', link: '/docs/v3/overview/donate' },
{ text: '参与开发', link: '/docs/v3/overview/contribute' },
{ text: '更新记录', link: '/docs/v3/overview/versions' },
{ text: '商业与企业服务', link: '/docs/v3/overview/business' }
]
},
{
text: '快速入门',
collapsed: false,
items: [
{ text: '安装', link: '/docs/v3/quick-start/install' },
{ text: '初始化', link: '/docs/v3/quick-start/init' },
{ text: '支付宝', link: '/docs/v3/quick-start/alipay' },
{ text: '微信', link: '/docs/v3/quick-start/wechat' },
{ text: '银联', link: '/docs/v3/quick-start/unipay' },
{ text: '返回格式', link: '/docs/v3/quick-start/return-format' }
]
},
{
text: '支付宝',
collapsed: false,
items: [
{ text: '支付', link: '/docs/v3/alipay/pay' },
{ text: '查询', link: '/docs/v3/alipay/find' },
{ text: '退款', link: '/docs/v3/alipay/refund' },
{ text: '关闭', link: '/docs/v3/alipay/close' },
{ text: '取消', link: '/docs/v3/alipay/cancel' },
{ text: '接收回调', link: '/docs/v3/alipay/callback' },
{ text: '确认回调', link: '/docs/v3/alipay/response' },
{ text: '更多便捷插件', link: '/docs/v3/alipay/more' },
]
},
{
text: '微信',
collapsed: false,
items: [
{ text: '支付', link: '/docs/v3/wechat/pay' },
{ text: '查询', link: '/docs/v3/wechat/find' },
{ text: '退款', link: '/docs/v3/wechat/refund' },
{ text: '关闭', link: '/docs/v3/wechat/close' },
{ text: '取消', link: '/docs/v3/wechat/cancel' },
{ text: '接收回调', link: '/docs/v3/wechat/callback' },
{ text: '确认回调', link: '/docs/v3/wechat/response' },
{ text: '更多便捷插件', link: '/docs/v3/wechat/more' }
]
},
{
text: '银联',
collapsed: false,
items: [
{ text: '支付', link: '/docs/v3/unipay/pay' },
{ text: '查询', link: '/docs/v3/unipay/find' },
{ text: '退款', link: '/docs/v3/unipay/refund' },
{ text: '关闭', link: '/docs/v3/unipay/close' },
{ text: '取消', link: '/docs/v3/unipay/cancel' },
{ text: '接收回调', link: '/docs/v3/unipay/callback' },
{ text: '确认回调', link: '/docs/v3/unipay/response' },
{ text: '更多便捷插件', link: '/docs/v3/unipay/more' }
]
},
{
text: '核心架构',
collapsed: false,
items: [
{ text: '🚀 Rocket', link: '/docs/v3/kernel/rocket' },
{ text: '🧪 Pipeline', link: '/docs/v3/kernel/pipeline' },
{ text: '🔌 Plugin', link: '/docs/v3/kernel/plugin' },
{ text: '💤 Shortcut', link: '/docs/v3/kernel/shortcut' }
]
},
{
text: '其它',
collapsed: false,
items: [
{ text: '事件', link: '/docs/v3/others/event' },
{ text: '日志', link: '/docs/v3/others/logger' },
{ text: 'FAQ', link: '/docs/v3/others/faq' },
]
},
{
text: '升级指南',
collapsed: false,
items: [
{ text: 'v3.5 升级指南', link: '/docs/v3/upgrade/v3.5' },
{ text: 'v3.4 升级指南', link: '/docs/v3/upgrade/v3.4' },
{ text: 'v3.3 升级指南', link: '/docs/v3/upgrade/v3.3' },
{ text: 'v3.2 升级指南', link: '/docs/v3/upgrade/v3.2' },
{ text: 'v3.1 升级指南', link: '/docs/v3/upgrade/v3.1' },
{ text: 'v3.0 升级指南', link: '/docs/v3/upgrade/v3.0' }
]
}
] as DefaultTheme.Sidebar
1 change: 1 addition & 0 deletions web/.vitepress/sidebar/versions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default ['v3', 'v2', 'v1']
Loading

0 comments on commit 6318a1e

Please sign in to comment.