config.js 2.8 KB

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