hexo迁移到mac电脑
使用安装教程为mac安装homebrew:
注意添加brew到系统路径
1 2 3 4 5
| (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/gloria/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)
|
安装node.js和git
1 2 3 4 5
| brew install node.js
brew install git
|
安装hexo
1 2 3 4 5 6
| npm install -g hexo-cli
#安装 hexo-deployer-git npm install hexo-deployer-git --save
|
从git上将过往博客clone到本地
1 2
| #将hexo分支克隆到本地(注意克隆的时候一定要选择ssh而不是https) git clone -b hexo git@github.com:XUAN-98-L/XUAN-98-L.github.io.git hexo
|
hexo初始化
1 2 3 4 5 6 7
| #需要进入到hexo文件夹内 npm install hexo --save
#修改_config.yml中deploy的部分,将其从https改为ssh deploy: type: git repo: git@github.com:XUAN-98-L/XUAN-98-L.github.io.git
|
obsidian 和hexo连用
https://itreefly.com/posts/e5113722.html
obsidian将“文件与链接”中“使用wiki链接“关闭
使用obsidian打开_posts作为仓库,并安装Custom Attachment Location插件
设置Location for new attachment为:
./${filename}
并将rename attachment files打开
将修改后的文件推送到git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| ssh-keygen -t ed25519 -C "你的新账号邮箱" -f ~/.ssh/id_ed25519_xuan98l
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519_xuan98l
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519_xuan98l.pub
git config user.name "XUAN-98-L" git config user.email "GitHub邮箱"
git add . git commit -m “提交消息” git push
|