You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by wu...@apache.org on 2020/10/03 13:28:21 UTC

[incubator-pegasus-website] 03/04: fix docsearch display problem

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

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

commit 2fc480b21e0e16b81862a019da12630e2700269f
Author: neverchanje <wu...@gmail.com>
AuthorDate: Sat Oct 3 19:53:51 2020 +0800

    fix docsearch display problem
---
 _includes/algolia.html     |  1 -
 _includes/docs_header.html | 39 +++++++++++++++++++++------------------
 _includes/head.html        |  1 +
 _layouts/docs.html         |  3 +--
 4 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/_includes/algolia.html b/_includes/algolia.html
index 4b090ad..bc39503 100644
--- a/_includes/algolia.html
+++ b/_includes/algolia.html
@@ -1,4 +1,3 @@
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
 <script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
 
 <script>
diff --git a/_includes/docs_header.html b/_includes/docs_header.html
index 6b22083..f221616 100644
--- a/_includes/docs_header.html
+++ b/_includes/docs_header.html
@@ -1,15 +1,12 @@
-<nav class="navbar">
+<nav class="navbar is-hidden-desktop">
     <div class="navbar-brand">
-        <a href="{{ site.baseurl }}/" class="navbar-item is-hidden-desktop">
+        <a href="{{ site.baseurl }}/" class="navbar-item">
             <!-- Pegasus Icon -->
             <img src="{{ site.baseurl }}/assets/images/pegasus-square.png">
         </a>
-        <div class="navbar-item is-hidden-desktop">
+        <div class="navbar-item">
             {% include language-switch.html %}
         </div>
-        <div class="navbar-item is-hidden-desktop">
-            {% include searchbox.html %}
-        </div>
         <a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navMenu">
             <!-- Appears in mobile mode only -->
             <span aria-hidden="true"></span>
@@ -18,15 +15,10 @@
         </a>
     </div>
     <div class="navbar-menu" id="navMenu">
-        <div class="navbar-start is-hidden-mobile w-full">
-            <div class="navbar-item pl-0 w-full">
-                {% include searchbox.html %}
-            </div>
-        </div>
-        <div class="navbar-end is-hidden-desktop">
+        <div class="navbar-end">
             {% for item in site.data.docs_menu %}
             <!--dropdown-->
-            <div class="navbar-item has-dropdown is-hoverable ">
+            <div class="navbar-item has-dropdown is-hoverable">
                 <a href="{{ item.link | prepend: site.baseurl }}"
                     class="navbar-link {% if item.link == page.url %}is-active{% endif %}">
                     <span>
@@ -44,10 +36,21 @@
             </div>
             {% endfor %}
         </div>
-        <div class="navbar-end">
-            <div class="navbar-item is-hidden-mobile">
-                {% include language-switch.html %}
-            </div>
-        </div>
     </div>
 </nav>
+
+<nav class="navbar is-hidden-mobile">
+    <div class="navbar-start w-full">
+        <div class="navbar-item pl-0 w-full">
+            <!--TODO(wutao): Given the limitation of docsearch that couldn't handle multiple input,
+                I make searchbox only shown in desktop. Fix this issue when docsearch.js v3 released.
+                Related issue: https://github.com/algolia/docsearch/issues/230-->
+            {% include searchbox.html %}
+        </div>
+    </div>
+    <div class="navbar-end">
+        <div class="navbar-item">
+            {% include language-switch.html %}
+        </div>
+    </div>
+</nav>
\ No newline at end of file
diff --git a/_includes/head.html b/_includes/head.html
index 4224aef..d27bdeb 100644
--- a/_includes/head.html
+++ b/_includes/head.html
@@ -5,6 +5,7 @@
     <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/app.css">
     <link rel="shortcut icon" href="{{ site.baseurl }}/assets/images/favicon.ico">
     <link href="https://cdn.bootcdn.net/ajax/libs/tailwindcss/1.8.10/utilities.min.css" rel="stylesheet">
+    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
     <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
     <script src="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script>
     {% seo %}
diff --git a/_layouts/docs.html b/_layouts/docs.html
index 1f15426..c868b48 100644
--- a/_layouts/docs.html
+++ b/_layouts/docs.html
@@ -43,8 +43,7 @@
     </div>
 
     <script src="{{ site.baseurl }}/assets/js/app.js" type="text/javascript"></script>
+    {% include algolia.html %}
 </body>
 
-{% include algolia.html %}
-
 </html>
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org