基于hexo的博客

搭建好的博客网站 dengshuo7412.com

搭建步骤

  • 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

可以本地预览

http://localhost:4000

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文档

基于hexo创建博客(Github托管)的更多相关文章

  1. 基于Hexo搭建博客并部署到Github Pages

    基于Hexo搭建博客并部署到Github Pages 之前在简书上写东西,觉得自己还是太浮躁.本来打算用Flask自己写一个,以为是微框架就比较简单,naive.HTML.CSS.JS等都要学啊,我几 ...

  2. 基于Hexo的博客管理恢复

    若重装电脑或更换电脑后 该如何恢复博客的管理? 1.确保之前博客源代码文件夹及文件保存在公库或私库中 例如: 我这里采用的是闭源存放方案,故为私库 这是源码文件样式 2.在新电脑上重新安装git,no ...

  3. hexo干货系列:(四)将hexo博客同时托管到github和coding

    前言 之前我们把hexo托管在github,但是毕竟github是国外的,访问速度上还是有点慢,所以想也部署一套在国内的托管平台,之前查资料听说gitcafe,但是听说gitcafe已经被coding ...

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

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

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

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

  6. 将 Hexo 个人博客同时部署到 GitHub 和 Coding 上

    一.将个人博客托管到 GitHub 上 关于如何快速搭建自己的个人博客,如何完善自己的个人博客,什么是 GitHub ,如何将自己的博客代码托管到 GitHub 上面等等问题,我之前写过三篇文章已经做 ...

  7. Hexo 博客 github.io MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

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

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

  9. Github + Hexo 搭建博客

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

随机推荐

  1. python 携程asyncio实现高并发示例1

    import asyncio #携程(携程不是函数) async def print_hello(): while True: print("hello world") await ...

  2. 微信小程序 POST传值跳坑

    来源:https://www.cnblogs.com/ordinaryk/p/8430462.html 加这个就行了: header : { 'content-type': 'application/ ...

  3. Linux 文件常用权限

    -rw------- (600) 只有所有者才有读和写的权限 -rw-r--r-- (644) 只有所有者才有读和写的权限,组群和其他人只有读的权限 -rwx------ (700) 只有所有者才有读 ...

  4. 理解async/await

    async 和 await 在干什么 任意一个名称都是有意义的,先从字面意思来理解.async 是“异步”的简写,而 await 可以认为是 async wait 的简写.所以应该很好理解 async ...

  5. python的sqlalchemy框架

    先看一下sqlalchemy框架中的映射,sqlalchemy一共有三种映射方式:传统映射(classic).现代化映射(modern).自定义映射.在这里,只为大家讲一下classic映射和mode ...

  6. element-ui 通用表单封装及VUE JSX应用

    一.存在及需要解决的问题 一般在做后台OA的时候会发现表单重复代码比较多,且逻辑基本一样,每次新加一个表单都需要拷贝基本一致的代码结构,然后只是简单地修改对应的字段进行开发 二.预期结果 提取重复的表 ...

  7. Spring.getBean()流程和循环依赖的解决

    getBean流程介绍(以单例的Bean流程为准) getBean(beanName) 从BeanFactory中获取Bean的实例对象,真正获取的逻辑由doGetBean实现. doGetBean( ...

  8. centos6安装创建kvm虚拟机

    的虚拟机名 virsh domid name                            # 显示虚拟机id号 virsh domuuid name                      ...

  9. rabbitMQ消息队列原理

    MQ:Message Queue,消息队列,是一种应用程序对应用程序的通信方法:应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们. 1      rabbitMQ入 ...

  10. 图论--差分约束--POJ 3159 Candies

    Language:Default Candies Time Limit: 1500MS   Memory Limit: 131072K Total Submissions: 43021   Accep ...