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. AutoCAD2018_64bit

    「AutoCAD_2018_Simplified_...hinese_Win_64bit」https://www.aliyundrive.com/s/eiLscbxkMui 点击链接保存,或者复制本段 ...

  2. servlet - 从本地下载图片

    import javax.servlet.ServletException;import javax.servlet.ServletOutputStream;import javax.servlet. ...

  3. Topsis法的python实现

    TOPSIS (Technique for Order Preference by Similarity to an Ideal Solution )法是C.L.Hwang和K.Yoon于1981年首 ...

  4. nodejs 配置国内镜像

    npm config set registry https://registry.npm.taobao.org npm config set disturl https://npm.taobao.or ...

  5. vue中使用Echart将一组数据展示出三种统计图

    1 <template> 2 <div class="container"> 3 <div id="myEchart" style ...

  6. miou

    1. 前言 本文学习记录了机器学习中的分类常见评价指标以及分割中的MIoU. 主要有以下概念:Accuracy, Precision, Recall, Fscore,混淆矩阵,IoU及MIoU. 2. ...

  7. 12.15linux学习第十八天

    今天老刘讲了如同天书一般的隐藏章节,第23章使用OpenLDAP部署目录服务,难度太高了.第16章使用Squid部署代理缓存服务 章节概述: 本章首先介绍代理服务的原理以及作用,然后介绍Squid服务 ...

  8. 对Java要学东西的认识 (一点点javascript见解)

    JavaScript是一种脚本语言,它采用小程序段的方式实现编程.像其它脚本语言一样,JavaScript同样已是一种解释性语言,它提供了一个易的开发过程.它的基本结构形式与C.C++.VB十分类似. ...

  9. 【第4次作业】CNN实战

    使用VGG模型进行猫狗大战 import numpy as np import matplotlib.pyplot as plt import os import torch import torch ...

  10. Java中简单易懂的HashMap面试题(面试必备)

    这篇文章仅限小编个人的理解,小编不是Java方向的,只是对Java有很高的学习兴趣 如果有什么不对的地方还望大佬指点 HashMap的底层是数组+链表,(很多人应该都知道了) JDK1.7的是数组+链 ...