File tree 5 files changed +285
-34
lines changed
5 files changed +285
-34
lines changed Original file line number Diff line number Diff line change 12
12
},
13
13
"dependencies" : {
14
14
"@astrojs/tailwind" : " ^4.0.0" ,
15
+ "@docsearch/js" : " ^3.5.1" ,
15
16
"@tailwindcss/typography" : " ^0.5.9" ,
16
17
"astro" : " ^2.10.7" ,
17
18
"tailwindcss" : " ^3.3.3"
Original file line number Diff line number Diff line change
1
+ <button
2
+ id =" docsearch"
3
+ class =" p-2 mr-2 hidden md:flex justify-between items-center bg-gray3 bg-opacity-10 hover:bg-opacity-20 border border-gray4 hover:border-orange-500 transition-all"
4
+ >
5
+ </button >
6
+
7
+ <script >
8
+ import docsearch from "@docsearch/js";
9
+ import "@docsearch/css";
10
+ console.log("docsearch");
11
+
12
+ docsearch({
13
+ container: "#docsearch",
14
+ appId: "FPK5SXN3GJ",
15
+ indexName: "sveltefire-fireship",
16
+ apiKey: "15bb134d41bb45724983679a6126b5f8",
17
+ });
18
+ </script >
Original file line number Diff line number Diff line change
1
+ ---
2
+ import Search from ' ./Search.astro'
3
+ ---
4
+
5
+
1
6
<nav
2
7
transition:persist
3
8
class =" flex justify-between mx-auto h-20 px-6 w-full bg-gray1 dark:bg-gray7 z-50 relative"
31
36
</li >
32
37
33
38
<li class =" mx-4" >
34
- <button
35
- class =" p-2 mr-2 hidden md:flex justify-between items-center bg-gray3 bg-opacity-10 hover:bg-opacity-20 border border-gray4 hover:border-orange-500 transition-all"
36
- >
37
- <span class =" text-gray4 dark:text-gray2 w-4 mx-2" >
38
- <svg
39
- aria-hidden =" true"
40
- focusable =" false"
41
- data-prefix =" fad"
42
- data-icon =" search"
43
- role =" img"
44
- xmlns =" http://www.w3.org/2000/svg"
45
- viewBox =" 0 0 512 512"
46
- class =" svg-inline--fa fk-search fk-w-16 fk-9x"
47
- >
48
- <g class =" fk-group"
49
- ><path
50
- fill =" currentColor"
51
- d =" M208 80a128 128 0 1 1-90.51 37.49A127.15 127.15 0 0 1 208 80m0-80C93.12 0 0 93.12 0 208s93.12 208 208 208 208-93.12 208-208S322.88 0 208 0z"
52
- class =" fk-secondary" ></path ><path
53
- fill =" currentColor"
54
- d =" M504.9 476.7L476.6 505a23.9 23.9 0 0 1-33.9 0L343 405.3a24 24 0 0 1-7-17V372l36-36h16.3a24 24 0 0 1 17 7l99.7 99.7a24.11 24.11 0 0 1-.1 34z"
55
- class =" fk-primary"
56
- >
57
- </path ></g
58
- ></svg
59
- >
60
- </span >
61
- <span class =" mr-12 font-code" >search</span >
62
- <span class =" mx-2 text-xs border border-gray4 rounded-md p-1 px-2"
63
- >/</span
64
- >
65
- </button >
39
+ <Search />
66
40
<button class =" flex md:hidden" >
67
41
<span class =" text-gray2 w-6 mx-2" ></span >
68
42
</button >
112
86
sidebar.classList.toggle("hidden");
113
87
};
114
88
</script >
115
-
116
- <style ></style >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import Footer from "../components/Footer.astro";
18
18
19
19
<title >SvelteFire Documentation</title >
20
20
<script async defer src =" https://buttons.github.io/buttons.js" ></script >
21
+ <link rel =" preconnect" href =" https://FPK5SXN3GJ-dsn.algolia.net" crossorigin />
21
22
<ViewTransitions />
22
23
</head >
23
24
<body class =" dark:bg-gray6 dark:text-white transition-colors duration-500" >
@@ -53,3 +54,25 @@ import Footer from "../components/Footer.astro";
53
54
</script >
54
55
</body >
55
56
</html >
57
+
58
+
59
+ <style is:global >
60
+
61
+ .DocSearch-Button {
62
+ @apply flex items-center justify-center px-0;
63
+ }
64
+
65
+ .DocSearch-Button:hover, .DocSearch-Button:focus {
66
+ @apply shadow-none bg-transparent text-gray4;
67
+ }
68
+
69
+
70
+ .DocSearch-Search-Icon path {
71
+ @apply stroke-gray4;
72
+ }
73
+
74
+ .DocSearch-Button-Placeholder {
75
+ @apply font-code lowercase ml-2;
76
+ }
77
+
78
+ </style >
You can’t perform that action at this time.
0 commit comments