Skip to content

Commit 41da1c3

Browse files
committed
feat: add mkdocs
1 parent ae9ecd6 commit 41da1c3

24 files changed

Lines changed: 2422 additions & 0 deletions

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
permissions:
8+
contents: write
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
- name: Configure Git Credentials
15+
run: |
16+
git config user.name github-actions[bot]
17+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.x
21+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22+
- uses: actions/cache@v4
23+
with:
24+
key: mkdocs-material-${{ env.cache_id }}
25+
path: ~/.cache
26+
restore-keys: |
27+
mkdocs-material-
28+
- run: pip install mkdocs-material
29+
- run: mkdocs gh-deploy --force

docs/assets/images/pp.jpg

625 KB
Loading

docs/assets/stylesheets/extra.css

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
.md-typeset__table {
2+
min-width: 100%;
3+
}
4+
5+
@media only screen and (min-width: 768px) {
6+
td:nth-child(1) {
7+
white-space: nowrap;
8+
}
9+
}
10+
11+
@font-face {
12+
font-family: Telegraf-Regular;
13+
src: url("typography/Telegraf-Regular.otf");
14+
}
15+
16+
@font-face {
17+
font-family: Telegraf-UltraBold;
18+
src: url("typography/Telegraf-UltraBold.otf");
19+
}
20+
21+
.Telegraf-Regular {
22+
font-family: Telegraf-Regular;
23+
}
24+
25+
.Telegraf-UltraBold {
26+
font-family: Telegraf-UltraBold;
27+
}
28+
29+
* {
30+
/*--md-primary-fg-color: rgba(59, 130, 246, 0.4);*/
31+
--md-primary-fg-color--light: #029c8e;
32+
--md-primary-fg-color--dark: #303c55;
33+
--md-typeset-color: var(--md-default-fg-color);
34+
--md-typeset-a-color: var(--md-primary-fg-color--light);
35+
--md-text-font: "Telegraf-Regular";
36+
}
37+
38+
:root {
39+
--md-tooltip-width: 600px;
40+
--md-primary-fg-color: #181917;
41+
--md-primary-fg-color--light: #029c8e;
42+
--md-primary-fg-color--dark: #303c55;
43+
}
44+
45+
:root > * {
46+
--md-primary-bg-color: #000;
47+
--md-typeset-color: var(--md-default-fg-color);
48+
--md-typeset-a-color: var(--md-primary-fg-color--light);
49+
}
50+
51+
/*
52+
markdown and image alignment
53+
ALT tag and a CSS selector on the alt tag
54+
*/
55+
img[src*="#left"] {
56+
float: left;
57+
}
58+
img[src*="#right"] {
59+
float: right;
60+
}
61+
img[src*="#center"] {
62+
display: block;
63+
margin: auto;
64+
}
65+
66+
/*
67+
Tables set to 100% width
68+
*/
69+
.md-typeset__table {
70+
min-width: 100%;
71+
}
72+
73+
.md-typeset table:not([class]) {
74+
display: table;
75+
}
76+
77+
/*
78+
Colors for First Steps
79+
custom code blocks coloring
80+
*/
81+
.fsg-timestamp {
82+
color: grey;
83+
}
84+
.fsg-userinput {
85+
color: cornflowerblue;
86+
}
87+
.fsg-path,
88+
.fsg-prompt {
89+
color: mediumseagreen;
90+
}
91+
92+
/*
93+
Footer social media icons:
94+
set the size of the svg icons and the espace between them.
95+
*/
96+
.md-social__link {
97+
width: 2rem;
98+
}
99+
.md-social__link svg {
100+
max-height: 1.6rem;
101+
}
102+
103+
/*
104+
hide content only for mobile devices
105+
*/
106+
@media only screen and (min-device-width: 280px) and (max-device-width: 480px) {
107+
.hide-on-mobile {
108+
display: none;
109+
}
110+
}

docs/assets/stylesheets/extra.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Open links externally.
2+
var links = document.links;
3+
4+
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
5+
if (links[i].hostname != window.location.hostname) {
6+
links[i].target = '_blank';
7+
}
8+
}

docs/dev/git/bare-repo.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
sidebar_position: 2
3+
title: git bare repository
4+
tags:
5+
- git
6+
- bare-repo
7+
---
8+
9+
<!-- TOC -->
10+
11+
# How create bare repo
12+
>
13+
> [source](https://www.ackama.com/what-we-think/the-best-way-to-store-your-dotfiles-a-bare-git-repository-explained/)
14+
``` git init --bare $HOME/dotfiles ```
15+
16+
- add this to your .zshrc:
17+
18+
```git
19+
alias git-bare='/usr/bin/git --git-dir=$HOME/dotfiles --work-tree=$HOME'
20+
alias bare='git --git-dir=$HOME/dotfiles --work-tree=$HOME'
21+
```
22+
23+
```git
24+
alias git-bare='git --git-dir=$HOME/dotfiles --work-tree=$HOME'
25+
```
26+
27+
- Add files you want to commit
28+
29+
>[!Important] DELETE .git folder
30+
> Delete this folder which bare-repo you add. You can't use bare-repo while using .git track for different repo?
31+
32+
```git
33+
git-bare add ~/.git-bare/polybar ~/.git-bare/i3 ~/.git-bare/alacritty ~/Documents/screenloyout
34+
```
35+
36+
```git
37+
git-bare commit -m "add my files"
38+
```
39+
40+
- Add remote repo if you doing first time
41+
42+
```git
43+
git-bare remote add origin <remote-url>
44+
```
45+
46+
- Push change master or your `branch-name`.
47+
48+
```git
49+
git-bare push -u origin bare-repo
50+
```
51+
52+
## How to use .gitignore on bare repo?
53+
>
54+
>[!important] bare-repo .gitignore
55+
>Firstly you need to untrack files who is already tracked by git before using .gitignore.
56+
57+
1. Create global exclude file to your specific location:
58+
59+
```python
60+
# it's exlude files here because bare repo use `--work-tree=$HOME`(e.g /home/<user>/)
61+
bare config --global core.excludefile ~/.gitignore
62+
# or
63+
bare config --global core.excludefile ~/Documents/.gitignore
64+
```
65+
66+
2. Add file name to `~/.gitignore`
67+
3. Untrack if file already tracked by git or unstage if you commit the file. **==WARNING: THIS WOULD DELETE FILES==**
68+
69+
```python
70+
bare rm -r --cached .stfolder .stversions
71+
```
72+
73+
## How to get latest changes on bare-repo for other machines?
74+
75+
If you want to completely replace your local files with the latest version from the bare repository's branch and discard any untracked or modified files, you can follow these steps:
76+
77+
### 1. **Reset the Local Repository**
78+
79+
```python
80+
git fetch origin my-branch
81+
bare-fetch
82+
83+
git reset --hard origin/my-branch
84+
bare-reset
85+
```
86+
87+
## How to not get changes from bare-repo branch? (e.g qtile/**pycache** problem)
88+
89+
```python
90+
bare-push --force
91+
```
92+
93+
## How to revert one file?
94+
95+
```python
96+
# learn commit id
97+
git-bare log --follow -p -- flake.lock
98+
# revert back to commit changes. This will modify flake.lock to that commit changes.
99+
git-bare checkout <commit_id> -- flake.lock
100+
# Now you reverted back that commit changes to flake.lock
101+
# You can update file etc.
102+
```
103+
104+
## git doesn't look for folder changes. Add bare-repo again when you add folder
105+
106+
- For example, when you create a new folder or file inside qtile bare-repo don't update it via commit. Therefore, you need to add folder again to add new file and folders.
107+
108+
## How to add new folder to bare-repo?
109+
110+
```bash
111+
git-bare add ~/.git-bare/qtile
112+
git-bare commit -m "add qtile"
113+
git-bare push -u origin bare-repo
114+
```
115+
116+
## How to update bare-repo?
117+
118+
```python
119+
git-bare status #to see modifications
120+
git-bare commit -am 'updated <file_name>'
121+
git-bare push -u origin bare-repo
122+
```
123+
124+
## How to show readme.md on bare-repo?
125+
126+
- You just need to create readme.md folder like this: `qtile/docs/README.md`
127+
- This will show README.md file on qtile folder.
128+
129+
# Others
130+
131+
- If you want to duplicate all the objects from the main repo, do this inside the main repo:
132+
133+
```
134+
git push --all <url-of-bare-repo>
135+
```
136+
137+
Alternatively, do a fetch inside the bare repo:
138+
139+
```
140+
git fetch <url-of-main-repo>
141+
```
142+
143+
You cannot do a pull, because a pull wants to merge with `HEAD`​, which a bare repo does not have.
144+
You can add these as remotes to save yourself some typing in the future:
145+
I added origin to whatever-name section like this git-bare remote add origin `bare-repo-url`
146+
147+
- `git remote add <whatever-name> <url-of-other-repo>`
148+
- Then you can simply do
149+
- `git push --all <whatever-name>`
150+
- `git fetch <whatever-name>`
151+
- depending on what repo you're in. If `<whatever-name>`​ is `origin`​, you can even leave it out altogether.
152+
153+
<!-- /TOC -->

0 commit comments

Comments
 (0)