欢迎光临散文网 会员登陆 & 注册

Termux 利用 GitHub Page 搭建 Hexo

2022-01-18 23:37 作者:朝兮未闻道  | 我要投稿


博客地址:http://shit.xv4n.ml

Termux搭建hexo博客并部署到GitHub

安装

termux-change-repo

apt update

apt install git && nodejs && vim

apt update

npm install hexo -g

mkdir hexo

hexo init hexo

cd hexo

hexo server

部署到GitHub

安装ssh

apt install openssh

生成ssh key

ssh-keygen -t rsa -C "你注册Github用的邮箱"

然后回车

ssh-keygen -t rsa -C "你的邮箱"

# Creates a new ssh key using the provided email

Generating public/private rsa key pair.

Enter file in which to save the key (/your_home_path/.ssh/id_rsa):

再回车

Enter passphrase (empty for no passphrase): [你的密码]

Enter same passphrase again: [你的密码]

你输入的内容是不会显示的

输密码

确认密码

然后查看key的内容

 vim ~/.ssh/id_rsa.pub

把内容全部复制下来,打开https://github.com/settings/keys

title随便填

key就填你ssh key里的内容

然后

npm install hexo-deployer-git --save

然后

vim _config.yml

在里面找到并修改

deploy:

  type: git

  repo: git仓库项目地址

  branch: 分支

还有

url: https://用户名.github.io/

root: /

点ESC输:wq退出来

然后

git config --global user.name "GitHub用户名"

git config --global user.email "GitHub注册邮箱"

然后

hexo clean

hexo g

hexo d

输个ssh key密码就可以了上传到Github了

然后是主题配置

毕竟原主题实在丑

cd themes

git clone https://gitee/fak3adm1n/fexo.git

cd fexo

vim _config.yml

根据注释自己自定义一下就行

最后的最后

新建文章是hexo new post 文章标题

上传是:

hexo clean

hexo g

hexo d

祝成功!


Termux 利用 GitHub Page 搭建 Hexo的评论 (共 条)

分享到微博请遵守国家法律