Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docsearch backport 1.6 #534

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion website/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ disableKinds = ["taxonomy", "taxonomyTerm"]
# The major.minor version tag for the version of the docs represented in this
# branch of the repository. Used in the "version-banner" partial to display a
# version number for this doc set.
version = "main"
version = "latest"

# Flag used in the "version-banner" partial to decide whether to display a
# banner on every page indicating that this is an archived version of the docs.
Expand Down
2 changes: 2 additions & 0 deletions website/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
<link rel="stylesheet" href="{{ "/css/prism.css" | relURL }}"/>
{{ end -}}



{{ partial "hooks/head-end.html" . -}}

{{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}}
Expand Down
22 changes: 22 additions & 0 deletions website/layouts/partials/hooks/body-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,25 @@
<script src="{{ $jsCopy.RelPermalink }}"></script>
{{ end }}

<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>

<script type="text/javascript">

docsearch({

appId: 'A1FXAERJE4',

apiKey: '88f3a753878f24ffdcd3d786be775545',

indexName: 'kubeflow-manifests',

container: '#docsearch',

searchParameters: {
facetFilters: ["version: {{ .Site.Params.version }} "],
},
debug: true // Set debug to true if you want to inspect the modal

});
</script>

2 changes: 2 additions & 0 deletions website/layouts/partials/hooks/head-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
{{ $copyCss := resources.Get "css/copy-code-button.css" | minify }}
<link href="{{ $copyCss.RelPermalink }}" rel="stylesheet">
{{ end }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />

5 changes: 5 additions & 0 deletions website/layouts/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
</button>
<div class="collapse navbar-collapse ml-md-auto" id="main_navbar">
<ul class="navbar-nav ml-auto pt-4 pt-md-0 my-2 my-md-1">
<li class="nav-item mr-2 mr-lg-4 mt-1 mt-lg-0">
<div id="docsearch"></div>
</li>

{{ $p := . }}
{{ range .Site.Menus.main }}
<li class="nav-item mr-2 mr-lg-4 mt-1 mt-lg-0">
Expand All @@ -34,4 +38,5 @@
{{ end }}
</ul>
</div>

</nav>