This is an automated email from the ASF dual-hosted git repository.
shangxinli pushed a commit to branch production
in repository https://gitbox.apache.org/repos/asf/parquet-site.git
The following commit(s) were added to refs/heads/production by this push:
new 0a564ba Use algolia search
new b4fd076 Merge pull request #23 from vinooganesh/vinooganesh/addSearch
0a564ba is described below
commit 0a564baa0cff0a50daa0f0ed7a79d4dd9a1bc155
Author: Vinoo Ganesh <[email protected]>
AuthorDate: Thu Mar 31 14:01:14 2022 -0400
Use algolia search
---
config.toml | 2 +-
content/en/search.md | 5 -----
layouts/partials/hooks/body-end.html | 21 +++++++++++++++++++++
layouts/partials/hooks/head-end.html | 3 +++
layouts/partials/navbar.html | 35 +++++++++++++++++++++++++++++++++++
5 files changed, 60 insertions(+), 6 deletions(-)
diff --git a/config.toml b/config.toml
index 833620f..3f1ffd5 100644
--- a/config.toml
+++ b/config.toml
@@ -104,7 +104,7 @@ github_branch= "production"
# gcs_engine_id = "7e3f91e3eadecceaa"
# Enable Algolia DocSearch
-algolia_docsearch = false
+algolia_docsearch = true
# Enable Lunr.js offline search
offlineSearch = false
diff --git a/content/en/search.md b/content/en/search.md
deleted file mode 100644
index db62198..0000000
--- a/content/en/search.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: Search Results
-layout: search
-
----
diff --git a/layouts/partials/hooks/body-end.html
b/layouts/partials/hooks/body-end.html
new file mode 100644
index 0000000..68e9a1e
--- /dev/null
+++ b/layouts/partials/hooks/body-end.html
@@ -0,0 +1,21 @@
+{{ with .Site.Params.algolia_docsearch }}
+<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
+
+<script type="text/javascript">
+
+ docsearch({
+
+ appId: '399WOPSE6Q',
+
+ apiKey: '437a8e172549357b6ca768248caecff9',
+
+ indexName: 'parquet-apache',
+
+ container: '#search_box',
+
+ debug: true // Set debug to true if you want to inspect the modal
+
+ });
+
+</script>
+{{ end }}
diff --git a/layouts/partials/hooks/head-end.html
b/layouts/partials/hooks/head-end.html
new file mode 100644
index 0000000..f038c1e
--- /dev/null
+++ b/layouts/partials/hooks/head-end.html
@@ -0,0 +1,3 @@
+{{ with .Site.Params.algolia_docsearch }}
+<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"/></pre></li>
+{{ end }}
diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html
new file mode 100644
index 0000000..b20aec0
--- /dev/null
+++ b/layouts/partials/navbar.html
@@ -0,0 +1,35 @@
+{{ $cover := and (.HasShortcode "blocks/cover") (not
.Site.Params.ui.navbar_translucent_over_cover_disable) }}
+<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}}
td-navbar-cover {{ end }}flex-column flex-md-row td-navbar">
+ <a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
+ <span class="navbar-logo">{{ if .Site.Params.ui.navbar_logo
}}{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML
}}{{ end }}{{ end }}</span><span class="font-weight-bold">{{ .Site.Title
}}</span>
+ </a>
+ <div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
+ <ul class="navbar-nav mt-2 mt-lg-0">
+ {{ $p := . }}
+ {{ range .Site.Menus.main }}
+ <li class="nav-item mr-4 mb-2 mb-lg-0">
+ {{ $active := or ($p.IsMenuCurrent "main" .)
($p.HasMenuCurrent "main" .) }}
+ {{ with .Page }}
+ {{ $active = or $active ( $.IsDescendant .) }}
+ {{ end }}
+ {{ $pre := .Pre }}
+ {{ $post := .Post }}
+ {{ $url := urls.Parse .URL }}
+ {{ $baseurl := urls.Parse $.Site.Params.Baseurl
}}
+ <a class="nav-link{{if $active }}
active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL |
relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{
end }}>{{ with .Pre}}{{ $pre }}{{ end }}<span{{if $active }}
class="active"{{end}}>{{ .Name }}</span>{{ with .Post}}{{ $post }}{{ end }}</a>
+ </li>
+ {{ end }}
+ {{ if .Site.Params.versions }}
+ <li class="nav-item dropdown mr-4 d-none d-lg-block">
+ {{ partial "navbar-version-selector.html" . }}
+ </li>
+ {{ end }}
+ {{ if (gt (len .Site.Home.Translations) 0) }}
+ <li class="nav-item dropdown mr-4 d-none d-lg-block">
+ {{ partial "navbar-lang-selector.html" . }}
+ </li>
+ {{ end }}
+ </ul>
+ </div>
+ <div id="search_box" class="navbar-nav d-none d-lg-block">{{ partial
"search-input.html" . }}</div>
+</nav>