[PATCH] docs: Fix searching in the wiki

Peter Krempa posted 1 patch 1 year, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/5557b573e2ac9a8515c423e38764e3cd7dbb756c.1678710145.git.pkrempa@redhat.com
docs/js/main.js | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
[PATCH] docs: Fix searching in the wiki
Posted by Peter Krempa 1 year, 1 month ago
Conversion of the wiki to static pages means that the integrated search
no longer functions. Use the same approach we have for other search to
simply defer to google.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 docs/js/main.js | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/docs/js/main.js b/docs/js/main.js
index 2edc628304..c37f9756a7 100644
--- a/docs/js/main.js
+++ b/docs/js/main.js
@@ -54,21 +54,16 @@ function advancedsearch(e) {
         }
     }

+    form.setAttribute("action", "https://google.com/search");
+    newq.setAttribute("name", "q");
+
     if (what == "website") {
-        form.setAttribute("action", "https://google.com/search");
-        newq.setAttribute("name", "q");
         newq.value = "site:libvirt.org " + q.value;
     } else if (what == "wiki") {
-        form.setAttribute("action", "https://wiki.libvirt.org/index.php");
-        newq.setAttribute("name", "search");
-        newq.value = q.value;
+        newq.value = "site:wiki.libvirt.org " + q.value;
     } else if (what == "devs") {
-        form.setAttribute("action", "https://google.com/search");
-        newq.setAttribute("name", "q");
         newq.value = "site:redhat.com/archives/libvir-list " + q.value;
     } else if (what == "users") {
-        form.setAttribute("action", "https://google.com/search");
-        newq.setAttribute("name", "q");
         newq.value = "site:redhat.com/archives/libvirt-users " + q.value;
     }

-- 
2.39.2
Re: [PATCH] docs: Fix searching in the wiki
Posted by Daniel P. Berrangé 1 year, 1 month ago
On Mon, Mar 13, 2023 at 01:22:25PM +0100, Peter Krempa wrote:
> Conversion of the wiki to static pages means that the integrated search
> no longer functions. Use the same approach we have for other search to
> simply defer to google.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  docs/js/main.js | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|