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

liujun pushed a commit to branch mkdocs
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git

commit 460173041867eba95010f00ca269edf069a6d10f
Author: ken.lj <[email protected]>
AuthorDate: Thu Aug 13 16:28:26 2020 +0800

    customize search config
---
 mkdocs_en.yml                     |  5 ++++-
 mkdocs_zh.yml                     |  6 ++++++
 overrides/partials/tabs-item.html | 32 ++++++--------------------------
 3 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/mkdocs_en.yml b/mkdocs_en.yml
index 39fdca4..e1e3b84 100644
--- a/mkdocs_en.yml
+++ b/mkdocs_en.yml
@@ -175,6 +175,7 @@ theme:
   language: en
   features:
     - tabs
+    - search.highlight
     #- instant
   palette:
     scheme: default
@@ -190,7 +191,9 @@ theme:
 # Plugins
 plugins:
   - search
-
+    prebuild_index: true
+    separator: '[\s\-\.]+'
+    include_search_page: true
 # Customization
 extra:
   social:
diff --git a/mkdocs_zh.yml b/mkdocs_zh.yml
index 14a02b2..1ebde8a 100644
--- a/mkdocs_zh.yml
+++ b/mkdocs_zh.yml
@@ -193,6 +193,7 @@ theme:
   language: zh
   features:
     - tabs
+    - search.highlight
     #- instant
   palette:
     scheme: default
@@ -208,6 +209,11 @@ theme:
 # Plugins
 plugins:
   - search
+    prebuild_index: true
+    separator: '[\s\-\.]+'
+    lang:
+      - ja
+      - zh
   - minify:
       minify_html: true
 
diff --git a/overrides/partials/tabs-item.html 
b/overrides/partials/tabs-item.html
index ead385a..27bb985 100755
--- a/overrides/partials/tabs-item.html
+++ b/overrides/partials/tabs-item.html
@@ -1,25 +1,3 @@
-<!--
-  Copyright (c) 2016-2020 Martin Donath <[email protected]>
-
-  Permission is hereby granted, free of charge, to any person obtaining a copy
-  of this software and associated documentation files (the "Software"), to
-  deal in the Software without restriction, including without limitation the
-  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-  sell copies of the Software, and to permit persons to whom the Software is
-  furnished to do so, subject to the following conditions:
-
-  The above copyright notice and this permission notice shall be included in
-  all copies or substantial portions of the Software.
-
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
-  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-  IN THE SOFTWARE.
--->
-
 <!-- Home page -->
 {% if nav_item.is_homepage or nav_item.url == "index.html" %}
   <li class="md-tabs__item">
@@ -44,10 +22,12 @@
     <li class="md-tabs__item">{{nav_item.title}}
       <ul class="md-tabs__list">
         {% for versions_nav_item in nav_item.children %}
+          <li style="color:red">{{versions_nav_item.title}}</li>
+          {% set versions_title = versions_title | 
default(versions_nav_item.title) %}
           <!-- Recurse, if the first item has nested items -->
           {% if (versions_nav_item.children | first).children %}
-          {% set nav_item = versions_nav_item.children | first %}
-          {% include "partials/tabs-item.html" %}
+            {% set nav_item = versions_nav_item.children | first %}
+            {% include "partials/tabs-item.html" %}
 
           <!-- Render item -->
           {% else %}
@@ -57,14 +37,14 @@
                       href="{{ (versions_nav_item.children | first).url | url 
}}"
                       class="md-tabs__link md-tabs__link--active"
               >
-                  {{ versions_nav_item.title }}
+                  {{ versions_title }}
               </a>
               {% else %}
               <a
                       href="{{ (versions_nav_item.children | first).url | url 
}}"
                       class="md-tabs__link"
               >
-                  {{ versions_nav_item.title }}
+                  {{ versions_title }}
               </a>
               {% endif %}
           </li>

Reply via email to