Key steps for hexo


Having an independent website is a populor cool thing at persent and maybe you have been expecting to own your website, blog for for a long time. now I want to recommend you a simple tool to help you archieve these easily. it’s hexo

Why is it hexo? because it’s simple and stable and work well with github easily. using it can help you to deploy your website, blog to internet quickly. no cost and no time almost. all of these proofed hexo a very good approach to do such these things

Okay, let me see how to use hexo to set up your website. here i will focus on the specific steps to use hexo without too much expositions

1. Set up the hexo environment -
1.1 Download Node.js and Git and install them afterwards

1.2 Check the installation result by these commands -
Win + R and then enter the commands like this:

  • node -v
  • npm -v
  • git –version
    if these commands can return the edition information then we can cosider they are okay for installation

2. Connect github -
2.1 Sign in a github account with your email account
2.2 Creae a new repository in your github website like this, and make sure the customized ‘repository name’ is quite as same as your user name. doing this strictly so that you would be able to use your user name as a unique domain name in internet directly
create new repository in your github

3. Install hexo in your local -
3.1 Use npm to install hexo in one clicking
npm install -g hexo-cli

3.2 Initializate hexo and preview it in your local

hexo init # initialization
npm install # install all the required components

hexo clean # clean the buffer files
hexo generate # generate pages
hexo server # for local preview

so far, you already set up your hexo website in your local. next I will sum up the steps on how to deploy your website to github

4. Deploy your hexo website to github -
4.1 firstly, install hexo-deployer-git
npm install hexo-deployer-git --save
and then modify the config file _config.yml like this -

deploy:
  type: git
  repository: git@github.com:用户名/用户名.github.io.git
  branch: master

after this, execute the command hexo d to deploy your website into the github
and then you can access your hexo website use this url - https://用户名.github.io

5. Create your article -
5.1 Use this commend to create your blog article
hexo new "my new post"
after this, you should be able to find your article ‘my new post’ in source folder. and then use Markdown editor to complete your composition

5.2 Deploy your article to github
only execute these two steps to make it -

hexo g   # 生成页面
hexo d   # 部署发布

5.3 The common commend reference -

hexo new "name"       # 新建文章
hexo new page "name"  # 新建页面
hexo g                # 生成页面
hexo d                # 部署
hexo g -d             # 生成页面并部署
hexo s                # 本地预览
hexo clean            # 清除缓存和已生成的静态文件
hexo help             # 帮助

Okay, that all the key steps on how to build your own hexo website. hopfully this would be useful for your reference


Author: Alan_Yuan
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source Alan_Yuan !
  TOC