1,修改为淘宝yum
npm config set registry https://registry.npmmirror.com
2,查看是否换成功
npm config get registry
3,安装hexo框架
anpm install hexo-cli -g
4,查看hexo框架安装是否成功,成功会回显一长串版本号
hexo -v
5,拉取hexo,多次尝试,第一次可能拉去不成功。或者,使用管理员身份打开cmd,进到/blog目录下拉去。
hexo init
6,配置_config文件
# Deployment ## Docs: https://hexo.io/docs/one-command-deployment deploy: type: 'git' repo: [email protected]:jhyyj/jhyyj.github.io.git branch: main
7,配置ssh账户和邮箱
git config --global user.email #可以先使用这个命令查看邮箱 git config --global user.name #可以先使用这个命令查看用户名 git config --global user.email "xxx" //设置邮箱 你的Github邮箱 git config --global user.name "xxx" //设置用户名 你的Github名称
8,本地生成ssh公钥,按照提示回车三次即可成功,-大C
ssh-keygen -t rsa -C "刚刚那个邮箱"
9,查看刚刚生成的密钥,
cat ~/.ssh/id_rsa.pub
10,将密钥复制到github中
1,点击github头像 2,settings(设置) 3,左侧:SSH and GPG keys 4,New SSH key
5,名字随便起,然后复制就行
11,测试ssh是否连接成功
ssh -T [email protected] ############################################## #第一可能要验证一下,输入yes $ ssh -T [email protected] The authenticity of host 'github.com (20.205.243.166)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. Hi jhyyj! You've successfully authenticated, but GitHub does not provide shell access. taohua@DESKTOP-HP92KFN MINGW64 /c/blog $ ssh -T [email protected] Hi jhyyj! You've successfully authenticated, but GitHub does not provide shell access.
12,安装自动部署工具
npm install hexo-deployer-git --save
13,hexo命令三剑客
hexo clean #清除之前生成的东西 hexo g #生成静态文章,generate hexo d #部署文章,hexo deploy标签:github,hexo,config,博客,git,ssh,com,搭建 From: https://blog.csdn.net/weixin_67430601/article/details/143199774