config.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. sidebar: {
  93. '/zh/pc/': genSidebar('pc', 'PC在线支付'),
  94. '/zh/android/': genSidebar('android', 'Android'),
  95. '/zh/ios/': genSidebar('ios', 'IOS'),
  96. '/zh/h5/': genSidebar('h5', 'H5'),
  97. '/zh/wx/': genSidebar('wx', '微信小程序'),
  98. }
  99. }
  100. }
  101. }
  102. }
  103. function genSidebar(name, title) {
  104. var child = {
  105. pc: [
  106. '',
  107. 'overview',
  108. 'flow',
  109. 'sign',
  110. 'purc',
  111. 'channel',
  112. 'common',
  113. 'test'
  114. ],
  115. android: [
  116. '',
  117. 'overview',
  118. 'flow',
  119. 'sign',
  120. 'purc',
  121. 'channel',
  122. 'common',
  123. '7'
  124. ],
  125. ios: [
  126. '',
  127. 'overview',
  128. 'flow',
  129. 'sign',
  130. 'purc',
  131. 'channel',
  132. 'common',
  133. '7'
  134. ],
  135. h5: [
  136. '',
  137. 'overview',
  138. 'flow',
  139. 'sign',
  140. 'purc',
  141. 'channel',
  142. 'common'
  143. ],
  144. wx: [
  145. '',
  146. 'overview',
  147. 'sign',
  148. 'purc',
  149. 'common',
  150. ],
  151. expup: [
  152. '',
  153. '1',
  154. '2',
  155. '3',
  156. '4',
  157. ],
  158. }
  159. return [{
  160. title,
  161. collapsable: false,
  162. children: child[name]
  163. }]
  164. }