Hexo-how-to

Overview

Target: Using Hexo to create Embux FAQ & Documentation website.

Note: Hexo is a fast, simple and powerful blog framework. You write posts in Markdown (or other languages) and Hexo generates static files with a beautiful theme in seconds.

Installation

Quick Guideline

  • Pre-requirement: Node.js and Git
  • Install Hexo $ npm install -g hexo-cli

  • fix git deploy error
    npm install hexo-deployer-git –save

  • hexo full text search
    npm install hexo-generator-search –save

Refer:

Setup

  • Initialize Hexo
1
2
3
$ hexo init <folder>  
$ cd <folder>
$ npm install

Note: , target folder to store the hexo website

Once the initialization complete, the folder structure will like

1
2
3
4
5
├──  _config.yml  # the major config file
├── package.json # application data
├── scaffolds # for each new post, Hexo bases the new file on it
├── source # where the document
└── themes # theme contents

Refer to Hexo: Getting Started - Setup for detail information.

Configuration

Modify site settings in _config.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Site
title: EMBUX

# URL
permailnk: :title/ # change to remove date&time folder type

# Writing
filename_case: 1 # use lower case for file naming

# Extensions
theme: embux # change to custom theme

# Deployment
deploy:
type: git
repo: https://github.com/embux/embux.github.io.git
branch: master

Refer to Hexo: Getting Started - Configuration for detail information.

Commands

  • init: $ hexo init <folder>
  • new: $ hexo new [layout] <title>
    • layout: using “draft” for imcomplete article
  • generate: $ hexo g
  • publish: $ hexo p # publish a draft
  • server: $ hexo s -p 4000 # start a local server for preview
  • deploy: hexo d # deploy web-site to pre-defined(_config.yml) web-site
  • clean: hexo clean # clean the cache file

Refer to Hexo: Getting Started - Commands for detail information.

Customization

Rss

npm install hexo-generator-feed --save

change themes/XXX/_config.yml

rss: /atom.xml

Sitemap

npm install hexo-generator-sitmap --save