config.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. '1',
  108. '2',
  109. '3',
  110. '4',
  111. '5',
  112. '6',
  113. ],
  114. android: [
  115. '',
  116. '1',
  117. '2',
  118. '3',
  119. '4',
  120. '5',
  121. '6',
  122. ],
  123. ios: [
  124. '',
  125. '1',
  126. '2',
  127. '3',
  128. '4',
  129. '5',
  130. '6',
  131. ],
  132. h5: [
  133. '',
  134. '1',
  135. '2',
  136. '3',
  137. '4',
  138. ],
  139. wx: [
  140. '',
  141. '1',
  142. '2',
  143. '3',
  144. '4',
  145. ],
  146. expup: [
  147. '',
  148. '1',
  149. '2',
  150. '3',
  151. '4',
  152. ],
  153. }
  154. return [{
  155. title,
  156. collapsable: false,
  157. children: child[name]
  158. }]
  159. }