基于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 ...
随机推荐
- SpringBoot项目集成Redis
一.在pom文件中添加依赖 <!-- 集成redis --> <dependency> <groupId>org.springframework.boot</ ...
- ISO及安全业务,机制
ISO 应用层 为应用软件提供接口,使应用程序能够使用网络服务. 各种应用程序协议如HTTP(Web),Telnet(远程控制),FTP(文本传输) 表示层 数据的交换格式.数据加密解密.数据的压缩解 ...
- 0day笔记(1)PE文件格式与虚拟文件内存的映射
PE文件格式 PE 文件格式把可执行文件分成若干个数据节(section),不同的资源被存放在不同的节中. 一个典型的 PE 文件中包含的节如下: .text 存放着二进制的机器代码 .data 初始 ...
- scrapy爬虫实例(1)
爬虫实例 对象 阳光问政平台 目标 : 主题,时间,内容 爬取思路 预先设置好items import scrapy class SuperspiderItem(scrapy.Item): title ...
- foreach里的按引用传值问题
1.foreach($arr as $k=>&$v){ } 这样循环时候最后一个结果前边会有&,出现输出不了的情况,这时候只需要加一个unset($v),加在循环里和外均可. 2 ...
- php header() 常用content-type
//定义编码 header( 'Content-Type:text/html;charset=utf-8 '); //Atom header('Content-type: application/at ...
- 2019-2020-1 20199303《Linux内核原理与分析》第六周作业
系统调用的三层机制 首先是为系统增加新的命令 运行脚本自动生成文件系统 其中有一个显示时间的功能 编辑test.c文件,增加一个hello函数用来显示学号,再次使用make roofts自动编译,调用 ...
- QString 转换成 wchar 的一个小陷阱
QString::toWCharArray(wchar_t * array) 其中 wchar_t * array 除了要分配内存之外,必须用 wmemset 初始化. 环境是 Visual Stud ...
- 基于Apache+Tomcat实现负载均衡
1.基于Apache和tomcat实现负载均衡 准备三个虚拟机一个安装Apache两个安装Tomcat 关闭防火墙 systemctl stop firewalld Iptabled -F Seten ...
- FluentAspects -- 基于 Fluent API 的 Aop
FluentAspects -- 基于 Fluent API 的 Aop Intro 上次我们做了一个简单的 AOP 实现示例,但是实现起来主要是基于 Attribute 来做的,对于代码的侵入性太强 ...