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

配置Github

root@hello:~/cby# git config --global user.name "cby-chen"
root@hello:~/cby# git config --global user.email "cby@chenby.cn"
root@hello:~/cby# ssh-keygen -t rsa -C "cby@chenby.cn"
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 cby@chenby.cn
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 git@github.com
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#

*将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

https://www.oiox.cn/

https://www.chenby.cn/

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

https://weibo.com/u/5982474121

https://blog.csdn.net/qq_33921750

https://my.oschina.net/u/3981543

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

https://segmentfault.com/u/hppyvyv6/articles

https://juejin.cn/user/3315782802482007

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/

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

GitHub+Hexo 搭建博客网站的更多相关文章

  1. 使用github+hexo搭建博客笔记

    听说github上可以搭博客,而且不用自己提供空间和维护,哈哈哈 作为一名程序猿,github搭博客对我有种神奇的吸引力,赶紧动手试一试 关于如何使用hexo搭建博客网上好的教程多如牛毛,而且这篇博客 ...

  2. github+hexo搭建博客

    引言     之前用阿里云弹性web托管采用wordpress搭建的个人博客,经过我使用一段时间之后发现存在很多问题: 网站的响应速度非常慢,估计打开主页需要3-4s的时间,我经过搜索发现很多人都有这 ...

  3. 手把手教 GitHub + Hexo 搭建博客

    前言 在很久以前,博主就想着要有自主的博客专栏或者网站.经历了博客园这个需要所谓的编辑审核,一直比较困惑,这些编辑是什么出身,怎么知道技术博客的价值性. 接下来找到了开源中国,这个可以自由发言的地方. ...

  4. Github + Hexo 搭建博客

    服务加速 brew 加速 http://blog.suconghou.cn/post/homebrew-speedup/ github加速 http://www.selfrebuild.net/201 ...

  5. 一个简单的hexo搭建博客网站的故事

    首先安装hexo mkdir hexo #创建一个文件夹 cd hexo #切换到hexo目录下面 npm install -g hexo-cli npm install hexo --save 然后 ...

  6. 手把手教从零开始在GitHub上使用Hexo搭建博客教程(四)-使用Travis自动部署Hexo(2)

    前言 前面一篇文章介绍了Travis自动部署Hexo的常规使用教程,也是个人比较推荐的方法. 前文最后也提到了在Windows系统中可能会有一些小问题,为了在Windows系统中也可以实现使用Trav ...

  7. 手把手教从零开始在GitHub上使用Hexo搭建博客教程(三)-使用Travis自动部署Hexo(1)

    前言 前面两篇文章介绍了在github上使用hexo搭建博客的基本环境和hexo相关参数设置等. 基于目前,博客基本上是可以完美运行了. 但是,有一点是不太好,就是源码同步问题,如果在不同的电脑上写文 ...

  8. 手把手教从零开始在GitHub上使用Hexo搭建博客教程(二)-Hexo参数设置

    前言 前文手把手教从零开始在GitHub上使用Hexo搭建博客教程(一)-附GitHub注册及配置介绍了github注册.git相关设置以及hexo基本操作. 本文主要介绍一下hexo的常用参数设置. ...

  9. 手把手教从零开始在GitHub上使用Hexo搭建博客教程(一)-附GitHub注册及配置

    前言 有朋友问了我关于博客系统搭建相关的问题,由于是做开发相关的工作,我给他推荐的是使用github的gh-pages服务搭建个人博客. 推荐理由: 免费:github提供gh-pages服务是免费的 ...

  10. 可能是最详细的 Hexo + GitHub Pages 搭建博客的教程

    前言:博主目前大三,Web 前端爱好者.写博客的好处,不是为了写而写,而是一个记录思想的过程.不要考虑它能带给你什么,而是你自己从中收获了什么. 最近刚好有空,于是就参照网上的各种教程,搭建了一个博客 ...

随机推荐

  1. Debug --> 使用USTC-TK2016工具对USTC-TFC2016数据集进行处理

    文件介绍: https://blog.csdn.net/u010916338/article/details/86511009?spm=1001.2101.3001.6661.1&utm_me ...

  2. Kubernetes快速部署

    Kubernetes快速部署 kubernetes简介 kubernetes,是一个全新的基于容器技术的分布式架构领先方案,是谷歌严格保密十几年的秘密武器----Borg系统的一个开源版本,于2014 ...

  3. 网络同步时钟单路耐压测试突破17V

    自动同步标准化考场时钟系统------专业LED时钟厂家![点击进入] 一.网络同步时钟耐压测试作用概述: 同步时钟耐压试验是鉴定时钟绝缘强度和稳定性最直接的方法,它对于判断NTP同步时钟设备能否投入 ...

  4. 用shell开火车哈哈

    用shell开火车!(σ゚∀゚)σ⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶ while true; do sl -aFile; done 这个效果更佳

  5. Mongodb可参考的查询

    条件AND 1 db.csr_log_info.find({$and:[{enterTime :{$regex:/2021-08-31 18:01/}},{enterTime :{$ne:" ...

  6. php 后台注册环信用户

    <?php //Easemob.php <?php /** -------------------------------------------------- 环信PHP REST示例代 ...

  7. 正向代理和反向代理和spring的动态代理模式有几种?默认是那种?如何切换?

    spring的动态代理模式有几种?默认是那种?如何切换? spring的动态的代理模式有两种 JDK动态代理,基于接口(默认代理模式),CGLIB动态代理(若要使用需要进行配置) JDK动态代理是由j ...

  8. Delaunay triangulation 的实现

    在GitHub 找到的别人的代码:https://github.com/earthwjl/DelaunayTriangulate 解压后是这样的:(没有x64) 直接就有了.sln工程文件,于是用Vi ...

  9. WebPack之懒加载原理

    代码结构 main.js console.log("这是main页面"); import(/* webpackChunkName: "foo" */" ...

  10. 使用IDEA的webservice工具解析生成的客户端调用远程接口

    由于这个接口的报文格式比较麻烦,是XML的请求头加上JSON格式的请求体,所以看起来比较复杂,也可以用RPC的方式调用,那样需要将请求头和请求体,响应头和响应体建实体.public JSONObjec ...