Browse Source

Add `Plugins` sidebar section, add `/api` redirects

@kvz :wave: :sparkles:
Artur Paikin 7 years ago
parent
commit
113a150426

+ 1 - 0
website/src/docs/index.md

@@ -2,6 +2,7 @@
 title: "Getting Started"
 type: docs
 permalink: docs/
+alias: api/
 order: 0
 ---
 

+ 2 - 2
website/src/docs/plugins.md

@@ -1,8 +1,8 @@
 ---
-title: "Plugins"
+title: "List & Common Options"
 type: docs
 permalink: docs/plugins/
-order: 2
+order: 3
 ---
 
 Plugins are what makes Uppy useful: they help select, manipulate and upload files.

+ 1 - 1
website/src/docs/server.md

@@ -2,7 +2,7 @@
 title: "Uppy Server"
 type: docs
 permalink: docs/server/
-order: 5
+order: 2
 ---
 
 Drag and Drop, Webcam, basic file manipulation (adding metadata, for example) and uploading via tus resumable uploads or XHR/Multipart are all possible using just the uppy client module. 

+ 6 - 2
website/src/stats.ejs

@@ -1,6 +1,10 @@
 ---
 title: Stats
-type: guide
+type: docs
 layout: stats
-permalink: stats/
+permalink: docs/stats/
+alias: 
+  - guide/stats/
+  - stats/
+order: 3
 ---

+ 1 - 1
website/themes/uppy/layout/partials/main_menu.ejs

@@ -7,6 +7,6 @@
 <!--li><a href="/guide/" class="nav-link<%- page.path.match(/guide/) ? ' current' : '' %>">Guide</a></li-->
 <li><a href="/docs/" class="nav-link<%- page.path.match(/docs/) ? ' current' : '' %>">Docs</a></li>
 <li><a href="/examples/dashboard/" class="nav-link<%- page.path.match(/examples/) ? ' current' : '' %>">Examples</a></li>
-<li><a href="/stats/" class="nav-link<%- page.path.match(/stats/) ? ' current' : '' %>">Stats</a></li>
+<!--li><a href="/stats/" class="nav-link<%- page.path.match(/stats/) ? ' current' : '' %>">Stats</a></li-->
 <li><a href="/blog/" class="nav-link<%- page.path.match(/blog/) ? ' current' : '' %>">Blog</a></li>
 <li><a href="https://github.com/transloadit/uppy" class="nav-link">Github</a></li>

+ 15 - 4
website/themes/uppy/layout/partials/sidebar.ejs

@@ -5,14 +5,25 @@
   <div class="list">
     <h2>
       <% if (page.type) { %>
-        <%- type === 'api' ? 'API' : (type.charAt(0).toUpperCase() + type.slice(1)) %>
+        <a href="/<%- type %>"><%- type === 'api' ? 'API' : (type.charAt(0).toUpperCase() + type.slice(1)) %></a>
       <% } %>
     </h2>
     <ul class="menu-root">
       <% site.pages.find({type: type}).sort('order').each(function (p) { %>
-        <li>
-          <a href="/<%- p.path %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
-        </li>
+        <% var path = p.path.replace(/index\.html$/, ''); %>
+        <% // https://github.com/vuejs/vuejs.org/blob/master/themes/vue/layout/partials/toc.ejs %>
+        <% if (path === 'docs/plugins/') { %>
+          <li>
+            <h3><a href="/docs/plugins/">Plugins</a></h3>
+          </li>
+          <li>
+            <a href="/<%- path %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
+          </li>
+        <% } else { %>
+          <li>
+            <a href="/<%- path %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
+          </li>
+        <% } %>
       <% }) %>
     </ul>
     <%- partial('partials/social') %>

+ 5 - 0
website/themes/uppy/source/css/_page.scss

@@ -66,6 +66,11 @@
     padding-left: 0;
   }
 
+  .menu-root h3 {
+    margin-top: 2em;
+    margin-bottom: 0.5em;
+  }
+
   .menu-sub {
     font-size: .85em;
     margin: 0.8em 0;