Skip to content

Commit 13fe7b6

Browse files
committed
🛠️ Fixes + New article
1 parent c4ede51 commit 13fe7b6

42 files changed

Lines changed: 3716 additions & 1181 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎_includes/nav.html‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,12 @@
127127
console.error("Search container not found");
128128
}
129129
}
130+
131+
document.addEventListener("keydown", (event) => {
132+
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
133+
event.preventDefault(); // Prevent default browser action
134+
openSearch();
135+
}
136+
});
130137
</script>
131138
</nav>

‎_includes/search.html‎

Lines changed: 35 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"
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-lg 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 mx-4 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 text-neutral-600 dark:text-neutral-100 hover:text-amber-400 text-lg pl-0"
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 text-neutral-600 dark:text-neutral-100 hover:text-amber-400 text-lg"
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");
@@ -69,8 +71,11 @@
6971
searchResultTemplate: `
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">
72-
<div>
74+
<div class="flex flex-row">
75+
<div class="flex flex-col ml-2">
7376
<p class="text-sm font-bold">{title}</p>
77+
<p class="text-sm">{details}</p>
78+
</div>
7479
</div>
7580
</a>
7681
</li>`,

‎_layouts/post.html‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h1 class="text-4xl dark:text-neutral-100 font-bold">
5151
{{ page.title }}
5252
</h1>
5353
<p class="text-sm text-neutral-600 dark:text-neutral-100">
54-
{{ page.details }}
54+
{{ page.description }}
5555
</p>
5656
</header>
5757

@@ -60,22 +60,31 @@ <h1 class="text-4xl dark:text-neutral-100 font-bold">
6060
</div>
6161

6262
<!-- Navigation for Previous and Next Posts -->
63+
{% assign posts_in_category = site.posts | where: "category",
64+
page.category | sort: "position" %} {% for post in posts_in_category
65+
%} {% if post.url == page.url %} {% assign current_index =
66+
forloop.index0 %} {% endif %} {% endfor %} {% assign previous_index =
67+
current_index | minus: 1 %} {% assign next_index = current_index |
68+
plus: 1 %}
69+
6370
<nav
6471
class="mt-8 flex justify-between border-t pt-4 dark:border-neutral-700"
6572
>
66-
{% if page.previous %}
73+
{% if previous_index >= 0 %} {% assign previous_post =
74+
posts_in_category[previous_index] %}
6775
<a
68-
href="{{ page.previous.url }}"
76+
href="{{ previous_post.url }}"
6977
class="px-4 py-2 text-sm font-medium text-amber-400"
7078
>
71-
&larr; Previous: {{ page.previous.title }}
79+
&larr; Previous: {{ previous_post.title }}
7280
</a>
73-
{% endif %} {% if page.next %}
81+
{% endif %} {% if next_index < posts_in_category.size %} {% assign
82+
next_post = posts_in_category[next_index] %}
7483
<a
75-
href="{{ page.next.url }}"
84+
href="{{ next_post.url }}"
7685
class="px-4 py-2 text-sm font-medium text-amber-400"
7786
>
78-
Next: {{ page.next.title }} &rarr;
87+
Next: {{ next_post.title }} &rarr;
7988
</a>
8089
{% endif %}
8190
</nav>

‎_posts/Beaver Notes/Dev/2025-01-03-How-to-contribute.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ One of the biggest ways to contribute is by helping with our documentation. We a
1414

1515
# Blog Posts
1616

17-
A blog is one of the best means for a project to grow and update its users on the work that is being done. Contributing to the blog means getting in touch with the developers to see what’s new, writing release articles, sharing tips and tricks, etc. In the following guide, [link to guide](), we’ll show you how you can contribute to the blog.
17+
A blog is one of the best means for a project to grow and update its users on the work that is being done. Contributing to the blog means getting in touch with the developers to see what’s new, writing release articles, sharing tips and tricks, etc. In the [following guide]({% post_url 2025-01-06-Contribute-to-blog %}), we’ll show you how you can contribute to the blog.
1818

1919
# Code Contributions
2020

21-
Code is obviously a great way to contribute to the project. By hunting down bugs, fixing issues open on GitHub, or implementing new features from the roadmap, you’ll be sure to leave your mark on Beaver and its growth. Follow this guide, [link to guide](), to set up the environment and get started.
22-
23-
If you don't feel quite ready to contribute to the app you can also contribute to Beaver’s website code, by following this guide: [link to guide]().
21+
Code is obviously a great way to contribute to the project. By hunting down bugs, fixing issues open on GitHub, or implementing new features from the roadmap, you’ll be sure to leave your mark on Beaver and its growth. Follow [this guide]({% post_url 2025-02-13-Code-Contributions %}), to set up the environment and get started.
2422

2523
# Translation
2624

27-
Beaver is enjoyed by people all around the world. You can help us reach even more people by helping us translate the desktop app. You could be the first to translate the app or update an existing translation. All translations are done using an open-source platform called [Traduora](). Check out this page to contribute to translations: [link to guide]()
25+
Beaver is enjoyed by people all around the world. You can help us reach even more people by helping us translate the desktop app. You could be the first to translate the app or update an existing translation. All translations are done using an open-source platform called Traduora. Check out [this page]({% post_url 2025-01-06-translate %}) to contribute to translations.
2826

2927
# UI and UX
3028

‎_posts/Beaver Notes/Dev/2025-01-05-Contribute-to-docs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
title: Contributing to the Docs
44
details: Good documentation is the foundation of a great project.
55
category: Beaver Notes (DEV)
6-
position: 2
6+
position: 3
77
---
88

99
Beaver's Documentation website is built using Jekyll, a static site generator. This makes collaboration straightforward, even if you’re not a developer. There are two main ways to contribute to the docs:

‎_posts/Beaver Notes/Dev/2025-01-06-Contribute-to-blog.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
title: Contributing to the Blog
44
details: An engaging blog is a good blog.
55
category: Beaver Notes (DEV)
6-
position: 3
6+
position: 4
77
---
88

99
Beaver's Blog website, like the docs, is built using Jekyll, a static site generator. To contribute to the blog, you don't need to be an artist, blogger, or developer.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
layout: post
3+
title: Code Contributions
4+
details: Help develop new features, squash bugs, and improve code
5+
category: Beaver Notes (DEV)
6+
position: 2
7+
---
8+
9+
Thank you for your interest in contributing to Beaver Notes! We are thrilled to have you on board.
10+
11+
# Prerequisites
12+
13+
Before contributing to the project, make sure you have the necessary tools installed:
14+
15+
- [**Node.js**](https://nodejs.org/): Version 22 or later
16+
- **Yarn**: `npm install -g yarn`
17+
18+
Once you have these, you can verify the versions using:
19+
20+
```
21+
node -v
22+
yarn -v
23+
```
24+
25+
# Getting Started
26+
27+
**1. Fork the Repository**
28+
29+
Click the Fork button at the top right of the repo and clone it to your machine:
30+
31+
```bash
32+
git clone https://github.com/your-username/Beaver-Notes.git
33+
34+
cd Beaver-Notes
35+
```
36+
37+
**2. Install Dependencies**
38+
39+
Ensure you have Yarn installed, then install dependencies:
40+
41+
```bash
42+
yarn install
43+
```
44+
45+
**3. Run the Project in Development Mode**
46+
47+
```bash
48+
yarn watch
49+
```
50+
51+
**4. Create a New Branch**
52+
53+
Use a descriptive name for your branch:
54+
55+
```bash
56+
git checkout -b feature/add-dark-mode
57+
```
58+
59+
# Code Style & Quality
60+
61+
### Linting
62+
63+
To maintain code quality, we use [Prettier](https://prettier.io/) for code formatting. Prettier will automatically format your code based on the `.prettierrc` configuration file.
64+
65+
You can run Prettier manually by executing:
66+
67+
```
68+
yarn prettier --write .
69+
```
70+
71+
We also use ESLint for static code analysis. This helps identify and fix code quality and style issues.
72+
73+
Run the linter:
74+
75+
```
76+
yarn lint
77+
```
78+
79+
Auto-fix lint issues:
80+
81+
```
82+
yarn lint --fix
83+
```
84+
85+
### Pre-commit Hooks (Husky and Lint-Staged)
86+
87+
We use [Husky](https://typicode.github.io/husky/) and [Lint-Staged](https://github.com/lint-staged/lint-staged) to ensure that code formatting and linting happen before committing changes.
88+
89+
Before you make a commit, the following will happen automatically:
90+
91+
- Prettier will format the code.
92+
- ESLint will check for issues and fix them if possible.
93+
94+
When attempting to commit, Husky will invoke the lint-staged script, which runs the following linting tasks:
95+
96+
```json
97+
"lint-staged": {
98+
"*.{js,ts,vue}": "eslint --cache --fix"
99+
}
100+
```
101+
102+
# 6. Commit and Push Changes
103+
104+
After making changes, commit and push them to the repository. Here’s a typical workflow:
105+
106+
1. Stage your changes:
107+
108+
```
109+
git add .
110+
```
111+
112+
2. Commit the changes:
113+
114+
```
115+
git commit -m "Your commit message"
116+
```
117+
118+
Husky will run Prettier and ESLint checks before committing.
119+
120+
3. Push the changes:
121+
122+
```
123+
git push origin branch-name
124+
```
125+
126+
127+
# 9. Submitting a Pull Request
128+
129+
> If you’re planning to make significant changes or add new features, ensure that you follow the project’s conventions. This includes:
130+
- Keeping the code consistent with the existing style.
131+
- Running Prettier and ESLint checks before pushing your changes.
132+
133+
Once your changes are committed and pushed to your branch, you can open a pull request (PR) to merge your changes into the development branch. They will be merged into the main branch once a new release is ready. Make sure to describe the changes in the PR description, including any important details. Also, check the relevant checkboxes. We know it can be boring, but it helps get your PR accepted faster.

0 commit comments

Comments
 (0)