You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ha...@apache.org on 2018/01/15 03:38:07 UTC

[5/5] incubator-weex-site git commit: Update sidebar title logic.

Update sidebar title logic.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/commit/40459c89
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/40459c89
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/40459c89

Branch: refs/heads/master
Commit: 40459c89d4a2ff20c5431e976464bdc87edc3f87
Parents: 915a445
Author: erha19 <fa...@gmail.com>
Authored: Mon Jan 15 11:31:29 2018 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Mon Jan 15 11:31:29 2018 +0800

----------------------------------------------------------------------
 themes/weex/layout/_partial/post/summary.ejs | 21 +++++++++++++++------
 themes/weex/source/css/partial/summary.scss  |  4 ++++
 2 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/40459c89/themes/weex/layout/_partial/post/summary.ejs
----------------------------------------------------------------------
diff --git a/themes/weex/layout/_partial/post/summary.ejs b/themes/weex/layout/_partial/post/summary.ejs
index a3b4744..a5f3c08 100644
--- a/themes/weex/layout/_partial/post/summary.ejs
+++ b/themes/weex/layout/_partial/post/summary.ejs
@@ -16,15 +16,24 @@
 
     <% pages.forEach(function (item, index) { %>
       <li>
-        <h3 class="chapter-title">
-          <span class="sidebar-link"><%- item[0].group %></span>
-        </h3>
+          <h3 class="chapter-title">
+            <% var find = _.find(item, {title: item[0].group}) %>
+            <% if(find && !_.isEmpty(find)){ %>
+              <a class="sidebar-link" href="<%= url_for(find.path) %>"><%- find.title %></a>
+            <% } else { %>
+              <span class="sidebar-link"><%- item[0].group %></span>
+            <% } %>
+          </h3>
+          
+
         <% if (item.length > 0) { %>
           <ul class="chapter">
             <% for (var i = 0; i < item.length; i++) { %>
-              <li>
-                <a href="<%= url_for(item[i].path) %>" class="sidebar-link <%- is_current(item[i].path, 'strict') ? 'current' : '' %> <%- item[i].is_new ? 'new' : '' %>"><%= item[i].title %></a>
-              </li>
+              <% if(item[i].title !== item[0].group){ %>
+                <li>
+                  <a href="<%= url_for(item[i].path) %>" class="sidebar-link <%- is_current(item[i].path, 'strict') ? 'current' : '' %> <%- item[i].is_new ? 'new' : '' %>"><%= item[i].title %></a>
+                </li>
+              <% } %>
             <% } %>
           </ul>
         <% } %>

http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/40459c89/themes/weex/source/css/partial/summary.scss
----------------------------------------------------------------------
diff --git a/themes/weex/source/css/partial/summary.scss b/themes/weex/source/css/partial/summary.scss
index 422971d..6676ea3 100644
--- a/themes/weex/source/css/partial/summary.scss
+++ b/themes/weex/source/css/partial/summary.scss
@@ -12,6 +12,7 @@
   }
 
   a {
+    color: #999;
     &.current {
       border: none;
       color: $text-blue;
@@ -23,6 +24,9 @@
 
   h3.chapter-title {
     font-size: 1.2em;
+    a {
+      color: #333;
+    }
   }
 
   ul.chapter {