Skip to content

Commit 4880e7f

Browse files
committed
🎉 Improvements + Article
1 parent 2739c33 commit 4880e7f

File tree

14 files changed

+121
-271
lines changed

14 files changed

+121
-271
lines changed

‎.DS_Store‎

0 Bytes
Binary file not shown.

‎_includes/footer.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
<!-- BlueSky -->
8181
<a
82-
href="https://bsky.app/profile/beavernotes.bsky.social"
82+
href="https://bsky.app/profile/beavernotes.com"
8383
class="text-neutral-400 hover:text-blue-500"
8484
>
8585
<span class="sr-only">BlueSky</span>

‎_includes/nav.html‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,13 @@
158158
console.error("Search container not found");
159159
}
160160
}
161+
162+
// Add event listener for keydown
163+
document.addEventListener("keydown", (event) => {
164+
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
165+
event.preventDefault(); // Prevent default browser action
166+
openSearch();
167+
}
168+
});
161169
</script>
162170
</nav>

‎_includes/search.html‎

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,35 @@
11
<div
22
id="search-container"
3-
class="fixed inset-x-0 top-10 hidden flex items-center justify-center z-50 mx-10"
4-
role="dialog"
5-
aria-labelledby="search-dialog-title"
6-
aria-hidden="true"
3+
class="fixed inset-0 bg-slate-900/25 backdrop-blur transition-opacity w-screen h-screen hidden flex z-50"
74
>
85
<div
9-
class="bg-white dark:bg-neutral-700 w-full max-w-xl rounded-lg shadow-xl relative"
6+
role="dialog"
7+
aria-labelledby="search-dialog-title"
8+
aria-hidden="true"
9+
class="fixed inset-0 z-50 flex items-start justify-center pt-16 sm:pt-24"
1010
>
1111
<div
12-
class="p-2 border-b border-b-neutral-100 dark:border-b-neutral-700 outline-none relative flex items-center"
12+
class="bg-white dark:bg-neutral-700 w-full max-w-xl rounded-lg shadow-xl relative"
1313
>
14-
<!-- Search Icon -->
15-
<i
16-
class="fa-solid fa-magnifying-glass p-2 text-neutral-600 dark:text-neutral-100 hover:text-amber-400 text-lg pl-2"
17-
></i>
18-
19-
<!-- Search Input -->
20-
<input
21-
id="search-input"
22-
type="text"
23-
class="text-sm bg-transparent outline-none border-none placeholder-neutral-500 dark:placeholder-neutral-300 dark:text-neutral-300 focus:ring-0 pl-4 pr-10"
24-
placeholder="Type to search..."
25-
aria-label="Search input"
26-
/>
27-
28-
<!-- Close Button -->
29-
<button
30-
onclick="closeSearch()"
31-
class="absolute right-0 top-1/2 transform -translate-y-1/2 text-neutral-400 hover:text-black focus:outline-none focus:ring-0"
32-
aria-label="Close search dialog"
14+
<div
15+
class="p-3 border-b border-b-neutral-100 dark:border-b-neutral-700 outline-none relative flex items-center justify-between"
3316
>
17+
<!-- Search Input -->
18+
<input
19+
id="search-input"
20+
type="text"
21+
class="flex-1 text-sm bg-transparent outline-none border-none placeholder-neutral-500 dark:placeholder-neutral-300 dark:text-neutral-300 focus:ring-0"
22+
placeholder="Type to search..."
23+
aria-label="Search input"
24+
/>
25+
26+
<!-- Search Icon -->
3427
<i
35-
class="fa-solid fa-close p-2 text-neutral-600 dark:text-neutral-100 hover:text-amber-400 text-lg mr-3"
28+
class="fa-solid fa-magnifying-glass p-2 text-neutral-600 dark:text-neutral-100 hover:text-amber-400 text-lg cursor-pointer"
3629
></i>
37-
</button>
30+
</div>
31+
<ul id="results-container" class="pb-2"></ul>
3832
</div>
39-
<ul id="results-container" class="space-y-2 py-2"></ul>
4033
</div>
4134
</div>
4235

@@ -49,13 +42,22 @@
4942
console.error("Search container not found");
5043
}
5144
}
45+
5246
// Initialize SimpleJekyllSearch
5347
document.addEventListener("DOMContentLoaded", () => {
5448
const searchInput = document.getElementById("search-input");
5549
const resultsContainer = document.getElementById("results-container");
5650

51+
// Add ESC key listener
52+
document.addEventListener("keydown", (e) => {
53+
if (e.key === "Escape") {
54+
e.preventDefault(); // Prevent default to avoid bubbling
55+
closeSearch();
56+
}
57+
});
58+
5759
// Inject site.baseurl from Jekyll into the JSON path
58-
const jsonPath = "{{ site.baseurl }}/assets/search.json"; // Inject site.baseurl here
60+
const jsonPath = "{{ site.baseurl }}/assets/search.json";
5961

6062
if (!searchInput || !resultsContainer) {
6163
console.error("Search input or results container not found");
@@ -70,7 +72,7 @@
7072
<li>
7173
<a href="{url}" class="flex items-center p-2 dark:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-600">
7274
<div class="flex flex-row">
73-
<img src="{{ site.baseurl }}/{image}" alt="{title}" class="w-auto h-12 rounded-lg" />
75+
<img src="{{ site.baseurl }}/{image}" alt="{title}" class="w-auto h-12 rounded" />
7476
<div class="flex flex-col ml-2">
7577
<p class="text-sm font-bold">{title}</p>
7678
<p class="text-sm">{description}</p>

‎_includes/welcomments/comment_form.html‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎_includes/welcomments/comments.html‎

Lines changed: 0 additions & 109 deletions
This file was deleted.

‎_includes/welcomments/single_comment.html‎

Lines changed: 0 additions & 57 deletions
This file was deleted.

‎_includes/welcomments/template.html‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎_layouts/post.html‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ <h1 class="text-4xl dark:text-neutral-100 font-bold">
101101
</div>
102102

103103
<div class="mt-8">
104-
{% include welcomments/comments.html website_id = "XBbDsxrQFlUyIMrdCpsy9Cqvc" %}
104+
<script
105+
src="https://utteranc.es/client.js"
106+
repo="Beaver-Notes/Beaver-Blog"
107+
issue-term="pathname"
108+
theme="preferred-color-scheme"
109+
crossorigin="anonymous"
110+
async
111+
></script>
105112
</div>
106113
</article>
107114

‎_posts/2025/2025-01-09-New Year = New Blog.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This doesn't impact the user's life much, but it makes my life a bit easier, and
3030

3131
# Thank You 💖
3232

33-
Thanks to all our users, contributors, and donors for making Beaver possible, and thanks for being part of this amazing community. Hope you enjoyed the article. If you’d like to help build and improve the project don’t hesitate to [Get Involved](https://beaver-notes.github.io/Beaver-Docs/docs/dev-docs/Beaver%20Notes/How%20to%20contribure)
33+
Thanks to all our users, contributors, and donors for making Beaver possible, and thanks for being part of this amazing community. Hope you enjoyed the article. If you’d like to help build and improve the project don’t hesitate to [Get Involved](https://docs.beavernotes.com/beaver%20notes%20(dev)/2025/01/03/How-to-contribute.html)
3434

3535
# Credits
3636

0 commit comments

Comments
 (0)