module.exports = { base: '/b2c/', dest: 'b2c', locales: { '/': { lang: 'en-US', title: 'AllPay', description: 'api docs' }, '/zh/': { lang: 'zh-CN', title: 'AllPay', description: 'api接入文档' } }, head: [ ['link', { rel: 'icon', href: `/favicon.ico` }], ['meta', { name: 'theme-color', content: '#3eaf7c' }], ], themeConfig: { repo: 'allpayx/b2c-docs', editLinks: true, docsDir: 'docs', locales: { '/': { label: 'English', selectText: 'Languages', editLinkText: 'Edit this page on GitHub', lastUpdated: 'Last Updated', nav: [{ text: 'PC Web', link: '/pc/', }, { text: 'Android', link: '/android/' }, { text: 'IOS', link: '/ios/' }, { text: 'HTML5', link: '/h5/' }, { text: 'ShoppingCart plug-in', link: '/cart/' }, { text: 'WechatMiniProgram', link: '/wx/' }, { text: 'Express Pay', link: '/expup/' }, ], sidebar: { '/pc/': genSidebar('pc', 'PC'), '/android/': genSidebar('android', 'Android'), '/ios/': genSidebar('ios', 'IOS'), '/h5/': genSidebar('h5', 'H5'), '/wx/': genSidebar('wx', 'wechatMiniProgram'), '/expup/': genSidebar('expup', 'Express Pay'), } }, '/zh/': { label: '简体中文', selectText: '选择语言', editLinkText: '在 GitHub 上编辑此页', lastUpdated: '上次更新', nav: [{ text: 'PC在线支付', link: '/zh/pc/', }, { text: 'Android', link: '/zh/android/' }, { text: 'IOS', link: '/zh/ios/' }, { text: 'HTML5', link: '/zh/h5/' }, { text: '开源商城插件', link: '/zh/cart/' }, { text: '微信小程序', link: '/zh/wx/' },{ text: '其它接口11', link: '/zh/other/' }, ], sidebar: { '/zh/pc/': genSidebar('pc', 'PC在线支付'), '/zh/android/': genSidebar('android', 'Android'), '/zh/ios/': genSidebar('ios', 'IOS'), '/zh/h5/': genSidebar('h5', 'H5'), '/zh/wx/': genSidebar('wx', '微信小程序'), '/zh/other/': genSidebar('other', '其它接口11122'), } } } } } function genSidebar(name, title) { var child = { pc: [ '', 'overview', 'flow', 'sign', 'purc', 'channel', 'common', 'test' ], android: [ '', 'overview', 'flow', 'sign', 'purc', 'channel', 'common', '7' ], ios: [ '', 'overview', 'flow', 'sign', 'purc', 'channel', 'common', '7' ], h5: [ '', 'overview', 'flow', 'sign', 'purc', 'channel', 'common' ], wx: [ '', 'overview', 'sign', 'purc', 'common', ], other: [ '', ], } return [{ title, collapsable: false, children: child[name] }] }