基于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 ...
随机推荐
- Linux-Discuz安装LAMP
1.下载,解压Discuz cd /data/discuz wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip un ...
- Oracle数据库排序后分页查询数据错误问题解决
一.问题描述:根据更新时间倒序排序然后分页查询数据,但是点击分页操作的时候,会出现数据重复看似没有操作的情况 二.问题错误原因分析 分页查询的SQL语句: select * FROM (select ...
- 关于go的通信通道channel——chan的一些问题
go版本 1.8 chan类型的声明,有以下几种: var c chan int c := make(chan int) //slice.map.chan都可以通过用make来初始化,其中map.ch ...
- PHP--关于上传文件大小的问题
参考:https://www.cnblogs.com/jianqingwang/p/5863960.html https://blog.csdn.net/u013168253/article/deta ...
- Selenium常见报错问题(1)- 先来认识下selenium常见异常类
如果你在跑selenium脚本时,需要某些异常不知道怎么解决时,可以看看这一系列的文章,看看有没有你需要的答案 https://www.cnblogs.com/poloyy/category/1749 ...
- python读取txt批量创建文件
python读取txt批量创建文件 pythonbatchfile 前几天有个小问题, 需要批量建立很多文件夹,, 所以手动写了个小的脚本, 后续可以直接使用 读取目录文件, 然后直接创建相应的文件 ...
- 5.Python是怎么解释的?
Python是怎么解释的? Python language is an interpreted language. Python program runs directly from the sour ...
- python的sqlalchemy框架
先看一下sqlalchemy框架中的映射,sqlalchemy一共有三种映射方式:传统映射(classic).现代化映射(modern).自定义映射.在这里,只为大家讲一下classic映射和mode ...
- includes与indexOf
indexOf(a,b)是在es6之前常用的判断数组/字符串内元素是否存在的api,接收两个参数,第一个a代表要被查找的元素,必填.第二个代表从数组的某个坐标开始查找,可选 在数组中 通过indexO ...
- for-loop 与 json.Unmarshal 性能分析概要
原文地址:for-loop 与 json.Unmarshal 性能分析概要 前言 在项目中,常常会遇到循环交换赋值的数据处理场景,尤其是 RPC,数据交互格式要转为 Protobuf,赋值是无法避免的 ...