基于hexo创建博客(Github托管)
基于hexo的博客
搭建步骤
1.依赖文件下载 Node.js
2.Hexo的安装
3.部署到Github
4.Hexo创建博客基本操作
5.Hexo主题皮肤更换
依赖文件Node.js
首先要安装node,npm 前端支持的基础文件
npm包管理,使用cnpm下载速度更快
npm install -g cnpm --registry=https://registry.npm.taobao.org
Hexo框架安装
1.框架安装
cnpm install -g hexo-cli
2.创建一个空文件夹,在文件下创建博客
mkdir blog
3.hexo 的生成,初始化博客
sudo hexo init
4.博客启动 start
hexo s
可以本地预览
5.编辑新文章
hexo n "文章名称"
hexo g 生成
部署到Github
1.安装github部署的工具
cnpm install --save hexo-deployer-git
vim _config.yml
配置文件
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: https://github.com/GeekDengshuo/GeekDengshuo.github.io.git
branch: master
2.部署命令
hexo d
Hexo创建博客基本操作
// 1.init
hexo init [folder] // Initializes a website. If no folder is provided, Hexo will set up the website in the current directory.
// 2.new
hexo new [layout] <title>
// Creates a new article. If no layout is provided, Hexo will use the default_layout from _config.yml.
// If the title contains spaces, surround it with quotation marks.
//3.generate
hexo generate
//Option Description
//-d, --deploy Deploy after generation finishes
//-w, --watch Watch file changes
//-b, --bail Raise an error if any unhandled exception is thrown during generation
//-f, --force Force regenerate
//-c, --concurrency Maximum number of files to be generated in parallel. Default is infinity
// 4.publish
hexo publish [layout] <filename>
// 5.server
hexo server
// Starts a local server. By default, this is at http://localhost:4000/.
//Option Description
//-p, --port Override default port
//-s, --static Only serve static files
//-l, --log Enable logger. Override logger format.
// 6.deploy
$ hexo deploy //Deploys your website.
//Option Description
//-g, --generate Generate before deployment
// 7.clean
$ hexo clean
//Cleans the cache file (db.json) and generated files (public).
hexo g // hexo generate
hexo s // hexo server
hexo d // hexo deploy
Hexo主题皮肤更换
1.克隆主题
git clone https://github.com/litten/hexo-theme-yilia 下载主题
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia // 拷贝到主题目录下
2.修改_config.yml
vim _config.yml
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: yilia
reference
基于hexo创建博客(Github托管)的更多相关文章
- 基于Hexo搭建博客并部署到Github Pages
基于Hexo搭建博客并部署到Github Pages 之前在简书上写东西,觉得自己还是太浮躁.本来打算用Flask自己写一个,以为是微框架就比较简单,naive.HTML.CSS.JS等都要学啊,我几 ...
- 基于Hexo的博客管理恢复
若重装电脑或更换电脑后 该如何恢复博客的管理? 1.确保之前博客源代码文件夹及文件保存在公库或私库中 例如: 我这里采用的是闭源存放方案,故为私库 这是源码文件样式 2.在新电脑上重新安装git,no ...
- hexo干货系列:(四)将hexo博客同时托管到github和coding
前言 之前我们把hexo托管在github,但是毕竟github是国外的,访问速度上还是有点慢,所以想也部署一套在国内的托管平台,之前查资料听说gitcafe,但是听说gitcafe已经被coding ...
- 手把手教从零开始在GitHub上使用Hexo搭建博客教程(一)-附GitHub注册及配置
前言 有朋友问了我关于博客系统搭建相关的问题,由于是做开发相关的工作,我给他推荐的是使用github的gh-pages服务搭建个人博客. 推荐理由: 免费:github提供gh-pages服务是免费的 ...
- 手把手教从零开始在GitHub上使用Hexo搭建博客教程(三)-使用Travis自动部署Hexo(1)
前言 前面两篇文章介绍了在github上使用hexo搭建博客的基本环境和hexo相关参数设置等. 基于目前,博客基本上是可以完美运行了. 但是,有一点是不太好,就是源码同步问题,如果在不同的电脑上写文 ...
- 将 Hexo 个人博客同时部署到 GitHub 和 Coding 上
一.将个人博客托管到 GitHub 上 关于如何快速搭建自己的个人博客,如何完善自己的个人博客,什么是 GitHub ,如何将自己的博客代码托管到 GitHub 上面等等问题,我之前写过三篇文章已经做 ...
- Hexo 博客 github.io MD
Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...
- 手把手教从零开始在GitHub上使用Hexo搭建博客教程(二)-Hexo参数设置
前言 前文手把手教从零开始在GitHub上使用Hexo搭建博客教程(一)-附GitHub注册及配置介绍了github注册.git相关设置以及hexo基本操作. 本文主要介绍一下hexo的常用参数设置. ...
- Github + Hexo 搭建博客
服务加速 brew 加速 http://blog.suconghou.cn/post/homebrew-speedup/ github加速 http://www.selfrebuild.net/201 ...
随机推荐
- redis:安装及基础知识(一)
Redis官网:https://redis.io/ Redis中文网:http://www.redis.cn/ Redis 是一个开源的,内存中的数据结构存储系统,它可以用作数据库.缓存和消息中间件. ...
- pysparnn 模块使用,相似句子召回
import pysparnn.cluster_index as ci from sklearn.feature_extraction.text import TfidfVectorizer data ...
- python慎用os.getcwd() ,除非你知道【文件路径与当前工作路径的区别】
当你搜索 "获取当前文件路径" 时,有的文章会提到用os.getcwd(),但是这玩意要慎用! 废话不多说,直接上例子: E:\program_software\Pycharm\y ...
- iOS appium
1.如果没有安装过Homebrew,先安装homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/ ...
- Nginx+Fastdfs
注: 在配置时,使用非root用户配置 fdfs/fdfs 1. 集群部署 1.1. 准备 创建目录:本文档中所有内容安装到/fdfs目录 [fdfs@5861be93b5b0 /]$mk ...
- Linux Centos7(Mac)安装Docker
docker 强调隔离性 docker:官网 docker:镜像官网: 镜像官网可以所有应用,选择安装环境:会给出安装命令,例如:docker pull redis 默认拉取最新的版本( ...
- 【Python】在Pycharm中安装爬虫库requests , BeautifulSoup , lxml 的解决方法
BeautifulSoup在学习Python过程中可能需要用到一些爬虫库 例如:requests BeautifulSoup和lxml库 前面的两个库,用Pychram都可以通过 File--> ...
- 【集群实战】NFS服务常见故障排查和解决方法
NFS,全名叫Network File System,中文叫网络文件系统,是Linux.UNIX系统的分布式文件系统的一个组成部分,可实现在不同网络上共享远程文件系统. NFS由Sun公司开发,目前已 ...
- 使用Node.js的http-serve搭建本地服务器
为什么要使用它? 首先,类似于vue-cli创建的项目,都能够实现浏览器中自动刷新,实时查看项目效果.其中的原理在于,webpack这样的工具启动了一个本地服务器,将本机当作一台服务器,这样在浏览器中 ...
- 短视频sdk:选择一个靠谱的短视频SDK 你需要了解这些
2017 年,短视频成为了内容创业的新风口,各种短视频 App 如雨后春笋般先后上线.随着互联网内容消费升级,视频越来越像文字.图片一样,成为每一个 App 不可或缺的一部分. 为了能够更好地聚焦于业 ...