You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/02/25 15:45:14 UTC

[skywalking-website] branch master updated: fix: menu shake (#230)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 722f3c4  fix: menu shake (#230)
722f3c4 is described below

commit 722f3c4f156b6eb66b46f80429feff705801d6c1
Author: Juntao Zhang <jt...@163.com>
AuthorDate: Thu Feb 25 23:45:07 2021 +0800

    fix: menu shake (#230)
---
 .gitignore                                      |  4 +++-
 themes/docsy/assets/scss/sidebar-menu.scss      | 17 ++++++++++++++++-
 themes/docsy/layouts/partials/sidebar-menu.html | 22 +++++++++++++++++++++-
 themes/docsy/layouts/projectDoc/baseof.html     | 22 ----------------------
 4 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/.gitignore b/.gitignore
index aa93e8e..b3994cb 100755
--- a/.gitignore
+++ b/.gitignore
@@ -28,4 +28,6 @@
 
 /tmp
 /data/docSidebar/*
-!.gitkeep
\ No newline at end of file
+!.gitkeep
+/content/docs/*
+!_index.md
diff --git a/themes/docsy/assets/scss/sidebar-menu.scss b/themes/docsy/assets/scss/sidebar-menu.scss
index 5048b21..16b9e0c 100644
--- a/themes/docsy/assets/scss/sidebar-menu.scss
+++ b/themes/docsy/assets/scss/sidebar-menu.scss
@@ -93,6 +93,7 @@
 
   .sidebar-menu li.active > a > .fa-angle-left {
     transform: rotate(-90deg);
+    color: #5c9af3;
   }
 
   .sidebar-menu li.active > .sidebar-submenu {
@@ -127,7 +128,7 @@
 
   .sidebar-menu .sidebar-submenu > li > a > .fa {
     width: 20px;
-    transition: transform 0.3s;
+    transition: transform 0.2s;
   }
 
   .sidebar-menu .sidebar-submenu > li > a > .fa-angle-left,
@@ -235,6 +236,20 @@
   .sidebar-menu-rtl .sidebar-submenu > li.active > a, .sidebar-menu-rtl .sidebar-submenu > li > a:hover {
     color: $blue;
   }
+  .fa.pull-right {
+    margin-left: .3em;
+  }
+
+  .pull-right {
+    float: right;
+  }
+  .fa-angle-left{
+    color: #999;
+  }
+  .fa {
+    display: inline-block;
+    font-weight: 100;
+  }
 
 }
 
diff --git a/themes/docsy/layouts/partials/sidebar-menu.html b/themes/docsy/layouts/partials/sidebar-menu.html
index 65cff04..50630a4 100644
--- a/themes/docsy/layouts/partials/sidebar-menu.html
+++ b/themes/docsy/layouts/partials/sidebar-menu.html
@@ -19,4 +19,24 @@
 
     {{ end }}
 
-</ul>
\ No newline at end of file
+</ul>
+<script src="/js/sidebar-menu.js"></script>
+<script>
+  (function (){
+    $.sidebarMenu($('.sidebar-menu'))
+    var path = window.location.pathname;
+    var hash = window.location.hash;
+    var $a = $('.sidebar-menu a')
+    $a.each(function (e){
+      if($(this).attr('href')+'/' === path || $(this).attr('href').replace('#','/#') === path+hash){
+        $(this).parents('li').addClass('active').show()
+      }
+    })
+    $a.on('click',function (){
+      var url = $(this).attr('href')
+      if(url!=='#'){
+        window.location.href = url
+      }
+    })
+  })()
+</script>
\ No newline at end of file
diff --git a/themes/docsy/layouts/projectDoc/baseof.html b/themes/docsy/layouts/projectDoc/baseof.html
index b95ed7b..f0e5ccf 100644
--- a/themes/docsy/layouts/projectDoc/baseof.html
+++ b/themes/docsy/layouts/projectDoc/baseof.html
@@ -3,7 +3,6 @@
   <head>
     {{ partial "head.html" . }}
     <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
-    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
   </head>
   <body class="td-{{ .Kind }}  project-doc">
     <header>
@@ -32,25 +31,4 @@
     {{ partial "sidebar-skywalking.html" . }}
     {{ partial "scripts.html" . }}
   </body>
-  <script src="/js/sidebar-menu.js"></script>
-  <script>
-    $(function (){
-      $.sidebarMenu($('.sidebar-menu'))
-      var path = window.location.pathname;
-      var hash = window.location.hash;
-      var $a = $('.td-sidebar a')
-      $a.on('click',function (){
-        var url = $(this).attr('href')
-        if(url!=='#'){
-          window.location.href = url
-        }
-      })
-      $a.each(function (e){
-        if($(this).attr('href')+'/'===path||$(this).attr('href').replace('#','/#') === path+hash){
-          $(this).parents('.sidebar-submenu').addClass('menu-open').show()
-          $(this).parents('li').addClass('active').show()
-        }
-      })
-    })
-  </script>
 </html>