config.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. module.exports = {
  2. base: '/b2c/',
  3. dest: 'b2c',
  4. locales: {
  5. '/': {
  6. lang: 'en-US',
  7. title: 'AllPay',
  8. description: 'api docs'
  9. },
  10. '/zh/': {
  11. lang: 'zh-CN',
  12. title: 'AllPay',
  13. description: 'api接入文档'
  14. }
  15. },
  16. head: [
  17. ['link', {
  18. rel: 'icon',
  19. href: `/favicon.ico`
  20. }],
  21. ['meta', {
  22. name: 'theme-color',
  23. content: '#3eaf7c'
  24. }],
  25. ],
  26. themeConfig: {
  27. repo: 'allpayx/b2c-docs',
  28. editLinks: true,
  29. docsDir: 'docs',
  30. locales: {
  31. '/': {
  32. label: 'English',
  33. selectText: 'Languages',
  34. editLinkText: 'Edit this page on GitHub',
  35. lastUpdated: 'Last Updated',
  36. nav: [{
  37. text: 'PC Web',
  38. link: '/pc/',
  39. }, {
  40. text: 'Android',
  41. link: '/android/'
  42. }, {
  43. text: 'IOS',
  44. link: '/ios/'
  45. }, {
  46. text: 'HTML5',
  47. link: '/h5/'
  48. }, {
  49. text: 'ShoppingCart plug-in',
  50. link: '/cart/'
  51. }, {
  52. text: 'WechatMiniProgram',
  53. link: '/wx/'
  54. }, {
  55. text: 'Express Pay',
  56. link: '/expup/'
  57. },
  58. ],
  59. sidebar: {
  60. '/pc/': genSidebar('pc', 'PC'),
  61. '/android/': genSidebar('android', 'Android'),
  62. '/ios/': genSidebar('ios', 'IOS'),
  63. '/h5/': genSidebar('h5', 'H5'),
  64. '/wx/': genSidebar('wx', 'wechatMiniProgram'),
  65. '/expup/': genSidebar('expup', 'Express Pay'),
  66. }
  67. },
  68. '/zh/': {
  69. label: '简体中文',
  70. selectText: '选择语言',
  71. editLinkText: '在 GitHub 上编辑此页',
  72. lastUpdated: '上次更新',
  73. nav: [{
  74. text: 'PC在线支付',
  75. link: '/zh/pc/',
  76. }, {
  77. text: 'Android',
  78. link: '/zh/android/'
  79. }, {
  80. text: 'IOS',
  81. link: '/zh/ios/'
  82. }, {
  83. text: 'HTML5',
  84. link: '/zh/h5/'
  85. }, {
  86. text: '开源商城插件',
  87. link: '/zh/cart/'
  88. }, {
  89. text: '微信小程序',
  90. link: '/zh/wx/'
  91. },{
  92. text: '其它接口11',
  93. link: '/zh/other/'
  94. }, ],
  95. sidebar: {
  96. '/zh/pc/': genSidebar('pc', 'PC在线支付'),
  97. '/zh/android/': genSidebar('android', 'Android'),
  98. '/zh/ios/': genSidebar('ios', 'IOS'),
  99. '/zh/h5/': genSidebar('h5', 'H5'),
  100. '/zh/wx/': genSidebar('wx', '微信小程序'),
  101. '/zh/other/': genSidebar('other', '其它接口11122'),
  102. }
  103. }
  104. }
  105. }
  106. }
  107. function genSidebar(name, title) {
  108. var child = {
  109. pc: [
  110. '',
  111. 'overview',
  112. 'flow',
  113. 'sign',
  114. 'purc',
  115. 'channel',
  116. 'common',
  117. 'test'
  118. ],
  119. android: [
  120. '',
  121. 'overview',
  122. 'flow',
  123. 'sign',
  124. 'purc',
  125. 'channel',
  126. 'common',
  127. '7'
  128. ],
  129. ios: [
  130. '',
  131. 'overview',
  132. 'flow',
  133. 'sign',
  134. 'purc',
  135. 'channel',
  136. 'common',
  137. '7'
  138. ],
  139. h5: [
  140. '',
  141. 'overview',
  142. 'flow',
  143. 'sign',
  144. 'purc',
  145. 'channel',
  146. 'common'
  147. ],
  148. wx: [
  149. '',
  150. 'overview',
  151. 'sign',
  152. 'purc',
  153. 'common',
  154. ],
  155. other: [
  156. '',
  157. ],
  158. }
  159. return [{
  160. title,
  161. collapsable: false,
  162. children: child[name]
  163. }]
  164. }