基于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. SpringCloud-Gateway 网关路由、断言、过滤

    Gateway 简介 是什么? Spring Cloud 全家桶中有个很重要的组件:网关.在 1.x 版本中使用的是 Zuul 网关,但是到了 2.x,由于Zuul的升级不断跳票,Spring Clo ...

  2. 树莓派4b 上手三板斧

    树莓派4b 上手三板斧 1.无屏幕和网线连接准备 windows / mac 电脑下载安装Notepad++ 新建文件并保存为ssh(该文件为空文件) 新建文件wpa_supplicant.conf ...

  3. Java封装 概述

    封装:是指隐藏对象的属性和实现细节,仅对外提供公共访问方式.好处:隐藏实现细节,提供公共的访问方式提高了代码的复用性提高安全性 封装原则:将不需要对外提供的内容都隐藏起来把属性隐藏,提供公共方法对其访 ...

  4. all_user_func()详解

    来源:https://blog.csdn.net/moliyiran/article/details/83514495 call_user_func — 把第一个参数作为回调函数调用 通过函数的方式回 ...

  5. php数组gbk和utf8的相互转化

    GBK转换成UFT-8用iconv()转化效率没有mb_convert_encoding()效率高eval() var_export() 把数组整体转化,如有一些特殊字符的话,可以用str_repla ...

  6. cmd命令行中无pip命令的解决办法

    cmd命令行中无pip命令的解决办法 只需简单的两步即可,按顺序执行以下命令(在cmd中): python -m ensurepip python -m pip install --upgrade p ...

  7. 2.Python是什么?使用Python的好处是什么?

    Python是什么?使用Python的好处是什么? 答: Python is a programming language with objects, modules, threads, except ...

  8. 《Splunk智能运维实战》——1.7 为本书加载样本数据

    本节书摘来自华章计算机<Splunk智能运维实战>一书中的第1章,第1.7节,作者 [美]乔史·戴昆(Josh Diakun),保罗R.约翰逊(Paul R. Johnson),德莱克·默 ...

  9. 崛起于Springboot2.X之开发拦截器(21)

    为什么80%的码农都做不了架构师?>>>   序言:几乎所有项目都需要拦截器,所以小伙伴们必须要掌握这门技术哦,不然只会mybaits增删改查那是实习生干的活呀. 1.创建拦截器类, ...

  10. 爱创课堂每日一题第十五题HTTP和HTTPS?

    HTTP协议通常承载于TCP协议之上,在HTTP和TCP之间添加一个安全协议层(SSL或TSL),这个时候,就成了我们常说的HTTPS.默认HTTP的端口号为80,HTTPS的端口号为443. 转载于 ...