config.js 3.0 KB

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