# Installation

{% tabs %}
{% tab title="GitHub installation (recommended)" %}
在博客根目录里安装最新版【推荐】

{% code title="正式版" fullWidth="true" %}

```sh
git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
```

{% endcode %}

{% hint style="info" %}
测试版可能存在 bug，追求稳定的请安装稳定版
{% endhint %}

如果想要安装比较新的 dev 分支，可以

{% code title="测试版" %}

```bash
git clone -b dev https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
```

{% endcode %}

**升级方法**：

利用git更新： 在主题目录下，运行 `git pull`，比对升级后的配置文件<mark style="color:blue;">**`_config.yml`**</mark>

或全量更新：删除**theme/anzhiyu**文件夹，然后重新执行安装命令即可。
{% endtab %}

{% tab title="npm installation" %}
This method only supports Hexo 5.0.0 and above **Installation through npm does not generate the theme folder in themes, but in node\_modules**

```bash
npm i hexo-theme-anzhiyu
```

> Upgrade method: in the Hexo root directory, run

```bash
npm update hexo-theme-anzhiyu
```

{% endtab %}
{% endtabs %}

What? You still won't? There's video here [AnZhiYu 主题安装教程](https://www.bilibili.com/video/BV1Rs4y127hu/?spm_id_from=333.788\&vd_source=4d9717102296e4b7a60ecdfad55ae2dd)

### 🛳 Apply Themes

Modify the hexo configuration file `_config.yml` and change the theme to anzhiyu

```yaml
theme: anzhiyu
```

### Install the pug and stylus rendering plug-in

```bash
npm install hexo-renderer-pug hexo-renderer-stylus --save
```

### Better configuration for easy upgrade theme

* Macos/linux runs in the root directory of the blog

  ```bash
  cp -rf ./themes/anzhiyu/_config.yml ./_config.anzhiyu.yml
  ```
* windows replication`/themes/anzhiyu/_config.yml`This file goes to the hexo root directory and is renamed`_config.anzhiyu.yml`

Please note<mark style="color:blue;">`_config.anzhiyu.yml`</mark>The configuration priority in is greater<mark style="color:blue;">`_config.yml`</mark>，Therefore, after updating the theme, you need to compare<mark style="color:blue;">`theme/anzhiyu/_config.yml`</mark> File content, generally in the git update logto be able to view and complete the changes.

### Start hexo locally

```
hexo cl
hexo g
hexo s
```

You can see the effect now.

### Is there a problem?

Can be submitted to the warehouse [issues](https://github.com/anzhiyu-c/hexo-theme-anzhiyu/issues)

### Group Chat

QQ Group number：`464636182`

![交流群464636182](https://3179365438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQrxdvjOvtnjrDj0Zzui%2Fuploads%2Fab6ziOKAXrsAqUrG8QNF%2F6438b945e1834.webp?alt=media\&token=2785722d-869d-4015-a887-84c9e910d2b9)

### Technical Support

Contact QQ`2268025923`or group chat`464636182`Internal consultation

### Theme Design

[@张洪 Heo](https://github.com/zhheo)
