config.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. 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. text: 'PC在线支付',
  70. link: '/zh/pc/',
  71. }, {
  72. text: 'Android',
  73. link: '/zh/android/'
  74. }, {
  75. text: 'IOS',
  76. link: '/zh/ios/'
  77. }, {
  78. text: 'HTML5',
  79. link: '/zh/h5/'
  80. }, {
  81. text: '开源商城插件',
  82. link: '/zh/cart/'
  83. }, {
  84. text: '微信小程序',
  85. link: '/zh/wx/'
  86. }, ],
  87. sidebar: {
  88. '/zh/pc/': genSidebar('pc', 'PC在线支付'),
  89. '/zh/android/': genSidebar('android', 'Android'),
  90. '/zh/ios/': genSidebar('ios', 'IOS'),
  91. '/zh/h5/': genSidebar('h5', 'H5'),
  92. '/zh/wx/': genSidebar('wx', '微信小程序'),
  93. }
  94. }
  95. }
  96. }
  97. }
  98. function genSidebar(name, title) {
  99. var child = {
  100. pc: [
  101. '',
  102. '1',
  103. '2',
  104. '3',
  105. '4',
  106. '5',
  107. '6',
  108. ],
  109. android: [
  110. '',
  111. '1',
  112. '2',
  113. '3',
  114. '4',
  115. '5',
  116. '6',
  117. ],
  118. ios: [
  119. '',
  120. '1',
  121. '2',
  122. '3',
  123. '4',
  124. '5',
  125. '6',
  126. ],
  127. h5: [
  128. '',
  129. '1',
  130. '2',
  131. '3',
  132. '4',
  133. ],
  134. wx: [
  135. '',
  136. '1',
  137. '2',
  138. '3',
  139. '4',
  140. ],
  141. }
  142. return [{
  143. title,
  144. collapsable: false,
  145. children: child[name]
  146. }]
  147. }