Skip to content

Commit

Permalink
补充相关文档
Browse files Browse the repository at this point in the history
  • Loading branch information
consistent-k committed May 23, 2024
1 parent 0ac5334 commit 387079c
Show file tree
Hide file tree
Showing 12 changed files with 13,146 additions and 11,518 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,25 @@ jobs:
with:
# 如果配置 themeConfig.lastUpdated 为 false,则不需要添加该参数以加快检出速度
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: 20
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Install dependencies
run: yarn
- name: Build with dumi

- name: Install pnpm (安装 pnpm)
uses: pnpm/action-setup@v2
with:
version: 8.15.6

- name: Install dependencies (安装依赖)
run: pnpm install

- name: Build (构建)
# 文档编译命令,如果是 react 模板需要修改为 npm run docs:build
run: yarn build
run: pnpm build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ A static site base on [dumi](https://d.umijs.org).

```bash
# install dependencies
$ yarn install
$ pnpm install

# start dev server
$ yarn start
$ pnpm dev

# build docs
$ yarn run build

# Locally preview the production build
$ yarn run preview
```

## LICENSE
Expand Down
37 changes: 37 additions & 0 deletions docs/Git/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Git


## 常用命令

### 配置用户名 & 邮箱
```bash
git config --global user.name "你的用户名"

git config --global user.email "你的邮箱地址"
```

### git stash

git stash 命令用于临时保存当前工作区的改动,这样你就可以在不提交改动的情况下切换到其他分支。

以下是一些常用的 git stash 命令:

* git stash save "message":将当前的改动保存到一个新的 stash 中,你可以提供一个可选的消息来描述这个 stash。
* git stash list:列出所有的 stash。
* git stash apply:应用最近的 stash 到当前工作区,但不会从 stash 列表中删除这个 stash。
* git stash pop:应用最近的 stash 到当前工作区,并从 stash 列表中删除这个 stash。
* git stash drop stash@{n}:删除指定的 stash。
* git stash clear:删除所有的 stash。


### git rebase

git rebase 命令用于将一系列提交应用到另一个基点上,它是 Git 中用于整理提交以使其更清晰的主要工具之一。

以下是一些常用的 git rebase 命令:

* git rebase <base>:将当前分支的提交应用到 <base> 分支上。这将使得当前分支的提交看起来像是在 <base> 分支的最新提交之后进行的。
* git rebase -i <base> 或 git rebase --interactive <base>:以交互方式进行 rebase。这将打开一个 UI,让你可以选择要如何处理每个提交(包括丢弃、修改提交信息、合并等)。
* git rebase --continue:在解决完 rebase 过程中的冲突后,使用此命令继续 rebase 进程。
* git rebase --abort:如果你想放弃当前的 rebase 进程,可以使用此命令。

8 changes: 8 additions & 0 deletions docs/Homebrew/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Homebrew


## 安装
```bash
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

```
4 changes: 2 additions & 2 deletions docs/NodeJS/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 安装NodeJS
# NodeJS


## 使用nvm管理工具安装
## 安装

```bash
# 安装nvm
Expand Down
1 change: 0 additions & 1 deletion docs/guide.md

This file was deleted.

Binary file added docs/iTem2/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/iTem2/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions docs/iTem2/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# iTem2


## 安装
```bash
# 官网下载
https://iterm2.com/
```

## 美化改造

### 配置

将iTem2设置为默认终端:(菜单栏)iTerm2 -> Make iTerm2 Default Term

![alt text](./image.png)

然后打开偏好设置preference,选中Keys,勾选Hotkey下的Show/hide iTerm2 with a system-wide hotkey,将热键设置为command+. ,这样你就可以通过command+. 全局热键来打开或关闭iTerm2窗口,非常方便。

![alt text](./image-1.png)



### 安装oh-my-zsh

github连接:https://github.com/robbyrussell/oh-my-zsh

使用 crul 安装:

```bash
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```

或使用wget:


```bash
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
```


### 主题

安装成功后,用vim打开隐藏文件 .zshrc ,修改主题为 agnoster:

```bash
ZSH_THEME="agnoster"
```

应用这个主题需要特殊的字体支持,否则会出现乱码情况,这时我们来配置字体:

1.使用 [Meslo](https://github.com/powerline/fonts/blob/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf) 字体,点开连接点击 view raw 下载字体。

2.安装字体到系统字体册。

3.应用字体到iTerm2下,我自己喜欢将字号设置为14px,看着舒服(iTerm -> Preferences -> Profiles -> Text -> Change Font)。

4.重新打开iTerm2窗口,这时便可以看到效果了。


### 自动提示命令

当我们输入命令时,终端会自动提示你接下来可能要输入的命令,这时按 → 便可输出这些命令,非常方便。

设置如下:

1.克隆仓库到本地 ~/.oh-my-zsh/custom/plugins 路径下

```bash
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
```

2.用 vim 打开 .zshrc 文件,找到插件设置命令,默认是 plugins=(git) ,我们把它修改为

```bash
plugins=(zsh-autosuggestions git)
```


3.重新打开终端窗口。

PS:当你重新打开终端的时候可能看不到变化,可能你的字体颜色太淡了,我们把其改亮一些:

移动到 ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions 路径下

```bash
cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
```

用 vim 打开 zsh-autosuggestions.zsh 文件,修改 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'


### 语法高亮

1.使用homebrew安装 zsh-syntax-highlighting 插件。

```bash
brew install zsh-syntax-highlighting
```

2.配置.zshrc文件,插入一行。

```bash
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
```

3.输入命令。

```bash
source ~/.zshrc
```
16 changes: 3 additions & 13 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
---
title: A static site based on dumi
title: 一些文档
hero:
title: Site
description: A static site based on dumi
title: Docs
description: 一些文档
actions:
- text: Hello
link: /
- text: World
link: /
features:
- title: Hello
emoji: 💎
description: Put hello description here
- title: World
emoji: 🌈
description: Put world description here
- title: '!'
emoji: 🚀
description: Put ! description here
---


Loading

0 comments on commit 387079c

Please sign in to comment.