" + categoryName + " (" + category.length + ")
";
// Display the top 5 results first.
appendString += "
";
@@ -173,9 +173,9 @@
if (result.type) {
switch (result.type) {
case "module":
- return "
";
+ return "
";
case "package":
- return "
"
+ return "
"
}
}
diff --git a/assets/sass/_animation.scss b/assets/sass/_animation.scss
new file mode 100644
index 000000000000..e558880f2f38
--- /dev/null
+++ b/assets/sass/_animation.scss
@@ -0,0 +1,12 @@
+@keyframes rotate360 {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+.spinner {
+ animation: rotate360 1s linear infinite;
+}
diff --git a/assets/sass/_search.scss b/assets/sass/_search.scss
new file mode 100644
index 000000000000..e489a3dc95ca
--- /dev/null
+++ b/assets/sass/_search.scss
@@ -0,0 +1,37 @@
+.search-results-category {
+ @apply mb-4 justify-between flex-1 p-4 bg-gray-200 text-sm overflow-auto rounded;
+
+ &:not(:last-of-type) {
+ @apply mr-4
+ }
+
+ h2 {
+ @apply mt-0 mb-4 text-gray-700 text-xl;
+ }
+
+ ul {
+ @apply p-0 list-none;
+
+ li {
+ .symbol {
+ &:before {
+ @apply text-white text-xs rounded mr-2 px-1;
+ }
+
+ &.module {
+ &:before {
+ content: "M";
+ @apply bg-green-700;
+ }
+ }
+
+ &.package {
+ &:before {
+ content: "Pk";
+ @apply bg-purple-700;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/assets/sass/styles.scss b/assets/sass/styles.scss
index 9ab0b89e8f89..26c73ac5bbde 100644
--- a/assets/sass/styles.scss
+++ b/assets/sass/styles.scss
@@ -3,16 +3,19 @@
@import "colors";
@import "mixins";
-@import "fonts";
+
+@import "animation";
@import "buttons";
-@import "tables";
@import "code";
+@import "fonts";
+@import "hubspot";
@import "icons";
-@import "toc";
@import "langchoose";
@import "no-select";
@import "pagination";
-@import "hubspot";
+@import "search";
+@import "tables";
+@import "toc";
h1, h2, h3, h4, h5, h6 {
@apply font-display text-gray-700 mb-2;
diff --git a/content/docs/search.md b/content/docs/search.md
index 651b2ca7504f..7e3443f3f699 100644
--- a/content/docs/search.md
+++ b/content/docs/search.md
@@ -1,5 +1,5 @@
---
-layout: "search"
-aliases: ["search.html"]
+title: Search Results
+layout: search
noindex: true
---
diff --git a/layouts/docs/list.html b/layouts/docs/list.html
index 4c3a4a87a0e7..f19971deca41 100644
--- a/layouts/docs/list.html
+++ b/layouts/docs/list.html
@@ -2,6 +2,16 @@
+
+
+ {{ partial "docs/search.html" . }}
+
+
+
+ {{ partial "docs/edit.html" . }}
+
+
+
{{ partial "docs/toc.html" . }}
@@ -10,10 +20,6 @@
{{ .Title }}
{{ .Content }}
-
-
- {{ partial "docs/edit.html" . }}
-
{{ end }}
diff --git a/layouts/docs/search.html b/layouts/docs/search.html
index d3a6aa79dfb4..05b45b6a9d1f 100644
--- a/layouts/docs/search.html
+++ b/layouts/docs/search.html
@@ -1,7 +1,23 @@
{{ define "main" }}
-