Skip to content
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
41 changes: 3 additions & 38 deletions source/_static/js/instantSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ window.addEventListener("DOMContentLoaded", () => {
const searchModalEl = document.getElementById("search");
const root = document.documentElement;

// Get the current doc platform
const activePlatform = document
.getElementsByTagName("meta")
["docsearch:platform"].getAttribute("content");

// Set search page title
// TODO: Do the right way
const pageName = document
Expand Down Expand Up @@ -103,8 +98,8 @@ window.addEventListener("DOMContentLoaded", () => {
initialUiState: {
minio: {
refinementList: {
platform: [activePlatform],
site: "docs"
site: "docs",
edition: "community",
},
},
},
Expand All @@ -128,17 +123,6 @@ window.addEventListener("DOMContentLoaded", () => {
if (query !== "") {
// Make search modal active
searchModalEl.classList.add("search--focused");

// Clear the filters and select the active platform
setTimeout(() => {
const activeFilterEl = document.querySelector(
".search__filters__checkbox[value='" + activePlatform + "']"
);

if (activeFilterEl && !activeFilterEl.checked) {
activeFilterEl.click();
}
}, 50);
} else {
// Clear the filters
clearRefinements();
Expand Down Expand Up @@ -201,7 +185,6 @@ window.addEventListener("DOMContentLoaded", () => {
</i>
<div class="search__hits__text">
<div class="search__hits__title">${data._highlightResult.hierarchy.lvl1.value}</div>
<div class="search__hits__platform">${data.platform}</div>
</div>
`;
}
Expand All @@ -219,7 +202,6 @@ window.addEventListener("DOMContentLoaded", () => {
<div class="search__hits__text">
<div class="search__hits__title">${data._highlightResult.hierarchy.lvl2.value}</div>
<div class="search__hits__label">
<div class="search__hits__platform">${data.platform}</div>
${data.hierarchy.lvl1}
</div>
</div>
Expand All @@ -239,7 +221,6 @@ window.addEventListener("DOMContentLoaded", () => {
<div class="search__hits__text">
<div class="search__hits__title">${data._highlightResult.hierarchy.lvl3.value}</div>
<div class="search__hits__label">
<div class="search__hits__platform">${data.platform}</div>
${data.hierarchy.lvl1}
</div>
</div>
Expand All @@ -262,7 +243,6 @@ window.addEventListener("DOMContentLoaded", () => {
data._snippetResult.content.value
}</div>
<div class="search__hits__label">
<div class="search__hits__platform">${data.platform}</div>
${data.hierarchy.lvl1}
${
data.hierarchy.lvl2
Expand Down Expand Up @@ -374,24 +354,9 @@ window.addEventListener("DOMContentLoaded", () => {
if (e.key === "Enter") {
const searchInputEl = document.querySelector(".search__input");
if (searchInputEl.value && document.activeElement === searchInputEl) {
var platform = "";
var environment = location.hostname === "localhost" || location.hostname === "127.0.0.1" ? "dev" : "prod";

if (activePlatform === "k8s") {
platform = "kubernetes/upstream";
} else if (activePlatform === "openshift") {
platform = "kubernetes/openshift";
} else if (activePlatform === "eks") {
platform = "kubernetes/eks";
} else if (activePlatform === "gke") {
platform = "kubernetes/gke";
} else if (activePlatform === "aks") {
platform = "kubernetes/aks";
} else {
platform = activePlatform;
}

var pathname = environment === "dev" ? "/search.html" : `/docs/minio/${platform}/search.html`;
var pathname = environment === "dev" ? "/search.html" : `/docs/minio/search.html`;

setTimeout(() => {
window.location.pathname = pathname;
Expand Down
56 changes: 4 additions & 52 deletions source/_static/scss/includes/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
&::placeholder {
color: var(--text-muted-color);
}

&:focus {
border-color: darken($neutral-subtle, 5%);
}
}

.search__reset {
Expand Down Expand Up @@ -276,17 +280,10 @@
vertical-align: middle;
color: var(--text-muted-color);
font-size: 0.65rem;
/* display: flex;
align-items: center; */
line-height: 1;
//margin-top: 0.35rem;
min-height: 1rem;
padding-bottom: 0.1rem;

.search__hits__platform {
margin-top: 0.2rem;
}

& > svg {
height: 0.8rem;
width: 0.8rem;
Expand All @@ -310,19 +307,6 @@
place-content: center;
}

.search__hits__platform {
font-size: 0.65rem;
color: var(--text-muted-color);
line-height: 1;
border: 1px solid var(--is-hit-platform-border-color);
border-radius: $border-radius;
padding: 0.1rem 0.2rem;
width: fit-content;
margin: 0.4rem 0.35rem 0 0;
display: inline-block;
}


.search__hits--empty {
margin: 0;
padding: 0;
Expand Down Expand Up @@ -454,14 +438,6 @@
margin-top: 1rem;
}

.search__form {
border: 1px solid var(--is-search-border-color);

&:focus-within {
box-shadow: 0 0 0 3px var(--is-search-focus-box-shadow);
}
}

#search-powered-by {
position: absolute;
top: -2.25rem;
Expand All @@ -477,30 +453,6 @@

&:not(.ais-Hits--empty) {
position: relative;

&:before {
content: "Search Results";
padding-left: 0.75rem;
font-size: $font-size-sm;
font-weight: $font-weight-medium;
display: inline-block;
background-color: var(--body-bg);
position: relative;
padding-right: 0.5rem;
z-index: 2;
padding-bottom: 0.5rem;
}

&:after {
content: "";
height: 1px;
position: absolute;
top: 1rem;
left: 0;
width: 100%;
z-index: 1;
background-color: var(--theme-light-bg);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions source/_templates/head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- Algolia meta attrs -->
<meta name="docsearch:site" content="docs"/>
<meta name="docsearch:edition" content="community"/>
<meta name="pagename" content="{{ pagename }}"/>

<!-- Preload fonts and scripts -->
Expand Down