config.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. module.exports = {
  2. dest: 'dist',
  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. }
  61. },
  62. '/zh/': {
  63. label: '简体中文',
  64. selectText: '选择语言',
  65. editLinkText: '在 GitHub 上编辑此页',
  66. lastUpdated: '上次更新',
  67. nav: [
  68. {
  69. text: 'PC在线支付',
  70. link: '/zh/pc/',
  71. },
  72. {
  73. text: 'Android',
  74. link: '/zh/android/'
  75. },
  76. {
  77. text: 'IOS',
  78. link: '/zh/ios/'
  79. },
  80. {
  81. text: 'HTML5',
  82. link: '/zh/h5/'
  83. },
  84. {
  85. text: 'shoppingCart plug-in',
  86. link: '/zh/cart/'
  87. },
  88. {
  89. text: 'wechatMiniProgram',
  90. link: '/zh/wx/'
  91. },
  92. ],
  93. sidebar: {
  94. '/zh/pc/':genSidebar('pc','PC在线支付'),
  95. '/zh/android/': genSidebar('android','Android'),
  96. '/zh/ios/': genSidebar('ios','IOS'),
  97. '/zh/h5/': genSidebar('h5','H5'),
  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. ],
  122. ios: [
  123. '',
  124. '1',
  125. '2',
  126. '3',
  127. '4',
  128. '5',
  129. ],
  130. h5: [
  131. '',
  132. '1',
  133. '2',
  134. '3',
  135. ],
  136. }
  137. return [
  138. {
  139. title,
  140. collapsable: false,
  141. children: child[name]
  142. }
  143. ]
  144. }