Skip to content

Commit 4197622

Browse files
committed
search
Signed-off-by: Lee Calcote <[email protected]>
1 parent 62e2025 commit 4197622

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

assets/scss/_navbar_project.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
}
1010

1111
.nav-link-external {
12-
border: 1px solid transparent;
12+
border: 1px solid $primary;
1313
border-radius: 0.25rem;
14-
color: $primary;
14+
color: $secondary;
1515
background: transparent;
1616
transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0s;
1717
}
1818

1919
.nav-link-external:hover {
20-
border: 1px solid $primary;
20+
border: 1px solid $secondary;
2121
color: $primary;
2222
box-shadow: $light 0 0 5px;
2323
background-color: transparent;

assets/scss/_styles_project.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,23 @@
2020
align-content: center;
2121
// background-color: #EBC017;
2222
background-color:#2e2e31;
23+
border-radius: 1rem;
24+
2325

2426
.td-search__input {
2527
width: 100%;
2628
text-indent: 1.25em;
27-
border-radius: 1rem; }
29+
border-radius: 1rem;
30+
}
2831
.td-search__input:not(:focus) {
29-
background: transparent; }
32+
background: transparent;
33+
border-radius: 1rem; }
3034
.td-search__input.form-control:focus {
31-
border-color: orange;
32-
box-shadow: 0 0 0 2px red;
3335
color: inherit; }
3436
}
3537
.td-search__input.form-control:focus {
3638

37-
background-color: #EBC017;
39+
// background-color: #EBC017;
3840
}
3941

4042
}
@@ -254,7 +256,7 @@ a:not([href]):not([class]):hover {
254256
.td-sidebar-toc {
255257
line-height: 1.25rem;
256258
border-left: 1px solid $border-color;
257-
background-color: $td-sidebar-toc-bg-color;
259+
background-image: linear-gradient(to top, #1e2117, #1d1912, #18120e, #0f0a09, #000000);
258260
@supports (position: sticky) {
259261
position: sticky;
260262
top: 4rem;

hugo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ github_project_repo = "https://github.com/layer5io/docs"
126126
github_branch = "master"
127127

128128
# Google Custom Search Engine ID. Remove or comment out to disable search.
129-
gcs_engine_id = "f475448a7bc1d43a4"
129+
# gcs_engine_id = "f475448a7bc1d43a4"
130130
# Layer5 search engine link https://cse.google.com/cse?cx=f475448a7bc1d43a4
131131
# Customization link https://programmablesearchengine.google.com/controlpanel/lookandfeel?cx=f475448a7bc1d43a4
132132

133133
# Enable Algolia DocSearch
134134
algolia_docsearch = false
135135

136136
# Enable Lunr.js offline search
137-
offlineSearch = false
137+
offlineSearch = true
138138

139139
# Enable syntax highlighting and copy buttons on code blocks with Prism
140140
prism_syntax_highlighting = false

layouts/partials/hotkey.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<style>
2-
#searchKey {
2+
/* #searchKey {
33
font-size: 16px;
44
font-weight: bold;
5-
color: black;
5+
color: white;
66
background-color: #cccccc;
77
border-radius: 6px;
88
margin: 0px;
9-
}
9+
} */
1010
</style>
11+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/main.min.css" />
1112
<script>
1213
function focusSearchBar() {
1314
var searchBar = document.querySelector(".td-search-input");
@@ -23,10 +24,17 @@
2324
}
2425
});
2526

27+
searchKey.addEventListener('mousedown', () =>{
28+
event.preventDefault();
29+
focusSearchBar();
30+
});
31+
2632
document.addEventListener("DOMContentLoaded", function () {
27-
var searchKey = document.createElement("div");
28-
searchKey.id = "searchKey";
2933

34+
var searchKey = document.getElementById("searchKey");
35+
if (searchKey) {
36+
searchBar.focus();
37+
}
3038
var searchElement = document.querySelector(".td-search-input");
3139
if (searchElement) {
3240
searchElement.appendChild(searchKey);

layouts/partials/navbar.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
<div class="td-search">
2323
<div class="td-search__icon"></div>
2424
<input type="search" class="td-search__input form-control td-search-input" placeholder="Search"
25-
aria-label="Search this site…" autocomplete="off"></div>
25+
aria-label="Search this site…" autocomplete="off">
26+
<button id="searchKey" style="margin-left:-2rem;" class="kbc-button kbc-button-xs">/</button>
27+
</div>
2628
</div>
2729
</div>
2830
</nav>

0 commit comments

Comments
 (0)