首页 > 其他分享 >GitHub+Hexo 搭建博客网站

GitHub+Hexo 搭建博客网站

时间:2022-10-11 13:34:37浏览次数:75  
标签:GitHub hexo Hexo com https cby root hello 搭建

    Hexo是一款基于Node.js的静态博客框架,依赖少易于安装使用,可以方便的生成静态网页托管在GitHub和Heroku上,是搭建博客的首选框架。


GitHub+Hexo 搭建博客网站_git


配置Github


root@hello:~/cby# git config --global user.name "cby-chen"
root@hello:~/cby# git config --global user.email "[email protected]"
root@hello:~/cby# ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:57aHSNuHDLRsy/UVOQKwrUmpKOqnkEbRuRc8jNrGVpU [email protected]
The key's randomart image is:
+---[RSA 3072]----+
| .o. |
| . = .E +. |
| . + * + .. . |
| = o.oo.o . + |
| o.*...oS.. . o |
|.oo.. *o. . |
|+. + Oo+ . |
|+ . =.=.+ |
| oo .o |
+----[SHA256]-----+
root@hello:~/cby# cat /root/.ssh/
authorized_keys id_rsa id_rsa.pub known_hosts

#需要配置到github上
#https://github.com/settings/ssh/new

root@hello:~/cby# ssh [email protected]
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi cby-chen! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
root@hello:~/cby#

GitHub+Hexo 搭建博客网站_github_02

*将id_rsa.pub文件中的内容粘贴进去


安装nvm工具


root@hello:~/cby# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
root@hello:~/cby# nvm install --lts
Installing latest LTS version.
Downloading and installing node v16.13.1...
Downloading https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz...
############################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.13.1 (npm v8.1.2)
root@hello:~/cby# nvm use --lts
Now using node v16.13.1 (npm v8.1.2)
root@hello:~/cby#
root@hello:~/cby# node -v
v16.13.1
root@hello:~/cby#


配置hexo环境,并修改主题


root@hello:~/cby# npm install -g hexo-cli
root@hello:~/cby# npm install hexo -g
root@hello:~/cby# npm update hexo -g
root@hello:~/cby# hexo init
INFO Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
INFO Install dependencies
INFO Start blogging with Hexo!

#修改主题
root@hello:~/cby# rm -rf scaffolds source themes _config.landscape.yml _config.yml package.json yarn.lock
root@hello:~/cby# git clone https://github.com/V-Vincen/hexo-theme-livemylife.git
root@hello:~/cby# mv hexo-theme-livemylife/* ./
root@hello:~/cby# rm -rf hexo-theme-livemylife
root@hello:~/cby# npm install


修改配置文件


root@hello:~/cby# vim _config.yml
root@hello:~/cby#
root@hello:~/cby#
root@hello:~/cby# cat _config.yml
#略

# Deployment
## Docs: https://hexo.io/docs/deployment.html
##
deploy:
type: git
repo: https://github.com/cby-chen/cby-chen.github.io.git # or https://gitee.com/<yourAccount>/<repo>
branch: master
root@hello:~/cby#


root@hello:~/cby# hexo clean
root@hello:~/cby# hexo g
root@hello:~/cby# hexo d


#注意,输入密码是需要输入token,创建时需要勾选所有权限
#https://github.com/settings/tokens/new


GitHub+Hexo 搭建博客网站_github_03




GitHub+Hexo 搭建博客网站_github_04





​https://www.oiox.cn/​

​https://www.chenby.cn/​

​https://cby-chen.github.io/​

​https://weibo.com/u/5982474121​

​https://www.zhihu.com/people/chen-bu-yun-2​

​https://space.bilibili.com/352476552/article​

​https://cloud.tencent.com/developer/column/93230​

​https://www.jianshu.com/u/0f894314ae2c​

​https://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/​

GitHub、知乎'思否、、简书、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客、全网可搜《小陈运维》

标签:GitHub,hexo,Hexo,com,https,cby,root,hello,搭建
From: https://blog.51cto.com/u_12212643/5746181

相关文章

  • 经GitHub将kubernetes镜像推送到阿里云
    背景在安装kubernetes时会出现无法访问镜像站的情况,通过GitHub将kubernetes镜像推送到阿里云之后,即可使用阿里云地址引用所需镜像,现已同步镜像5000+,当前还在陆续同步。仓......
  • 如何通过 API + 快捷指令,3分钟搭建固定资产盘点系统?
    前言 财务本身的工作十分繁忙,月初忙报税、出报表,月末忙结账对数,月中还得处理各种报销、记账、算工资等杂事,终日不是与Excel为伴,就是在去税局的路上。 每个季度、......
  • 如何搭建一套免费开源的微信群机器人问答系统?
    前言自动消息回复和机器人,一直是企业微信的专利。但在非常多场景或者人文习惯中,个人微信和微信群也同样需要它们。比如活动组织者、团购团长、社群管理、私域流量运营者......
  • 如何通过 API + 快捷指令,3分钟搭建活动邀请和签到系统?
    前言 举办活动,要邀请很多宾客。如何对他们做一对一的身份认证?如何群发邮件为他们进行活动邀请和通知?等到活动那天,现场扫码签到入场,你可能需要采购扫码设备或者购买付费......
  • 车牌识别(2)-搭建车牌识别模型
    上一期分享了模拟生成车牌的方法,今天分享一下搭建要给简单的车牌识别模型,模拟生成车牌的方法参看:​​车牌识别(1)-车牌数据集生成​​生成的车牌如下图准备数据集,图片放在path......
  • Linux下的lua和boost c++的搭建和安装
    先下载lua,boostc++​​http://www.lua.org/versions.html#5.2​​​​http://www.boost.org/​​ ​​http://sourceforge.net/projects/luabind/​​1.安装lua[root@l......
  • GitHub不能访问处理
    最近国内访问github.com经常打不开,无法访问。解决Github打不开办法打开网站http://tool.chinaz.com/dns/ ,在A类型的查询中输入github.com,找到最快访问的ip地址,并......
  • NTP服务器搭建
    NetworkTimeProtocol(网络时间协议)采用的是分层设计,Stratum层的总数限制在15以内(包括15)。1、服务端配置:安装ntp时间服务:yum-yinstallchrony服务端修改主配置文......
  • springboot H2 linux下搭建使用
    这次研究是H2数据库了,关键还是再Linux下进行搭建部署的,被这个数据库快弄死了弄了4天时间,现在大致可以用了,还有些细节需要修正。我这边使用的是springboot集成模式。直接使......
  • vscode如何链接git远程仓库gitee或github
    vscode如何链接git远程仓库gitee或githubhttps://blog.csdn.net/G_C_H/article/details/1206732271.在GitHub上创建新的仓库2.生成SSH密钥开启GitBash命令行中输......