sidebar.ejs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <%
  2. var categories = [
  3. // order: 2x
  4. { path: 'docs/plugins/', name: 'Plugins', link: true },
  5. // order: 3x
  6. { path: 'docs/dashboard/', name: 'Local Sources', link: false },
  7. // order: 4x
  8. { path: 'docs/providers/', name: 'Remote Providers', link: true },
  9. // order: 5x
  10. { path: 'docs/tus/', name: 'Uploaders', link: false },
  11. // order: 6x
  12. { path: 'docs/status-bar/', name: 'UI Elements', link: false },
  13. // order: 7x
  14. { path: 'docs/transloadit/', name: 'File Processing', link: false },
  15. // order: 8x
  16. { path: 'docs/form/', name: 'Miscellaneous', link: false },
  17. // order: 9x
  18. { path: 'docs/react/', name: 'React Components', link: true },
  19. // order: 10x
  20. { path: 'docs/robodog/', name: 'Robodog', link: true }
  21. ]
  22. %>
  23. <div class="Sidebar js-Sidebar">
  24. <ul class="main-menu">
  25. <%- partial('partials/main_menu') %>
  26. </ul>
  27. <div class="list">
  28. <h2>
  29. <% if (page.type) { %>
  30. <a href="/<%- type %>"><%- type === 'api' ? 'API' : (type.charAt(0).toUpperCase() + type.slice(1)) %></a>
  31. <% } %>
  32. </h2>
  33. <ul class="menu-root">
  34. <% site.pages.find({ type }).sort('order').each((p) => { %>
  35. <% if (p.hidden) return; %>
  36. <% var path = p.path.replace(/index\.html$/, ''); %>
  37. <% var category = categories.find((c) => c.path === path) %>
  38. <% // see https://github.com/vuejs/vuejs.org/blob/master/themes/vue/layout/partials/toc.ejs %>
  39. <% if (category) { %>
  40. <li>
  41. <% if (category.link) { %>
  42. <h3><a href="/<%- category.path %>"><%- category.name %></a></h3>
  43. <% } else { %>
  44. <h3><%- category.name %></h3>
  45. <% } %>
  46. </li>
  47. <li>
  48. <a href="/<%- path %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.menu || p.title %></a>
  49. </li>
  50. <% } else { %>
  51. <li>
  52. <a href="/<%- path %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.menu || p.title %></a>
  53. </li>
  54. <% } %>
  55. <% }) %>
  56. </ul>
  57. <%- partial('partials/social') %>
  58. </div>
  59. </div>