Home>Article>Web Front-end> How to use hexo to build your own blog

How to use hexo to build your own blog

一个新手
一个新手 Original
2017-09-07 14:05:44 1266browse


Use hexo to build your blog

Preparation conditions

  • node operating environment;

  • git environment (you need to go to github to pull the code, and you can also use this to push the code to github in the future)

Start working

1. Install hexo globally. If npm is too slow, you can set up Taobao mirror, or install cnpm directly

npm i -g hexo

2. Initialize hexo

hexo init hexoName #hexoName为你想建立的hexo目录cd hexoName npm install #安装各类包hexo g #自动生成静态文件hexo s #运行服务

Open http://localhost:4000/ without reporting an error You can access it. If you are prompted that the port is occupied, you can use

hexo s -p 1234 #1234为你指定的端口号

Of course this is the default hexo theme. Next we need to change the theme and upload it to the git free domain name

hexo commonly used commands

bash
hexo clear deletes the generated static files
hexo g generates static files, which are the pages you visit
hexo s starts hexo service
hexo d deployment
hexo init initialization
hexo new Create a new article or page

Summary:

hexo is a relatively simple and easy-to-use blog framework, and there are many themes for everyone to choose from

The above is the detailed content of How to use hexo to build your own blog. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn