
Hexo deploy shell script
安装 Node.js
使用 nvm 安装,Github 链接。
最好装一个 Windows Terminal,安装完后输入 nvm version
查看是否安装成功。
sh
1 | nvm version |
安装 Node.js 并选择需要的版本。若报错,以管理员身份运行。
sh
1 | nvm install 16.15.0 |
安装 Git
直接去 Git 官网下载,全部默认安装就行。
安装 Hexo
sh
1 | npm install -g hexo-cli |
查看是否安装成功
sh
1 | hexo -v |
如果以下错误
plaintext
1 | hexo : 无法加载文件 C:\Program Files\nodejs\hexo.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.micros |
执行
powershell
1 | set-executionpolicy remotesigned |
再查看版本即可
sh
1 | hexo -v |
新建博客文件夹,切换到此路径,执行 Hexo 初始化。
sh
1 | hexo init |
本地运行,此时可以看见博客界面了
sh
1 | hexo s |
安装 Butterfly 主题
sh
1 | git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly |
安装其他所需插件
sh
1 | # katex 插件 |
部署到 Github
sh
1 | hexo d |
若报以下错误,是因为没有配置 git。
plaintext
1 | Initialized empty Git repository in C:/Users/USER/Desktop/blog_source/.deploy_git/.git/ |
执行
sh
1 | git config --global user.email "you@example.com" |
再次执行 hexo d
时,会弹出 Github 登录窗口,登录即可部署。
将 rsa 添加到 Github
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 AOHUI BLOG.!
评论