瀏覽代碼

Issue #5036 -> Click on nav bar goes to top level doc

Closes issue #5036

This commit redirects the reader to top level doc upon clicking
on a main nav. menu item (eg. Installation [click] -> Mac OS X)

Docker-DCO-1.1-Signed-off-by: O.S. Tezer <ostezer@gmail.com> (github: ostezer)
O.S. Tezer 11 年之前
父節點
當前提交
8ae966de75
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 6 0
      docs/theme/mkdocs/css/docs.css
  2. 3 1
      docs/theme/mkdocs/nav.html

+ 6 - 0
docs/theme/mkdocs/css/docs.css

@@ -49,6 +49,12 @@ ol li {
   margin: 0px;
   margin: 0px;
   padding: 0em;
   padding: 0em;
 }
 }
+#nav_menu > #docsnav > #main-nav > li > a {
+  color: #253237;
+}
+#nav_menu > #docsnav > #main-nav > li.dd_on_hover > a {
+  color: #5992a3;
+}
 #nav_menu > #docsnav > #main-nav > li.dd_on_hover {
 #nav_menu > #docsnav > #main-nav > li.dd_on_hover {
   background: #b1d5df;
   background: #b1d5df;
   color: #5992a3;
   color: #5992a3;

+ 3 - 1
docs/theme/mkdocs/nav.html

@@ -4,7 +4,9 @@
       {% for menu in nav %}
       {% for menu in nav %}
       {% if menu.title != '**HIDDEN**' %}
       {% if menu.title != '**HIDDEN**' %}
       <li class="dd_menu pull-left{% if menu.active %} active{% endif %}">
       <li class="dd_menu pull-left{% if menu.active %} active{% endif %}">
-        <span>{{ menu.title }}</span>
+        {% for first_item in menu.children[:1] %}
+        <a href="{{ first_item.url }}">{{ menu.title }}</a>
+        {% endfor %}
         <ul class="dd_submenu" style="max-height: 75px;">
         <ul class="dd_submenu" style="max-height: 75px;">
         {% for menu in menu.children %}
         {% for menu in menu.children %}
           <li {% if menu.active %}class="active"{% endif %}>
           <li {% if menu.active %}class="active"{% endif %}>