First blog, hexo installation

After the estimated time entry selection may close one day, I used hexo framework and next theme, originally planned to adopt jekyll found there hexo framework is based on node.js, the former is required Ruby language, I found no basis for it, but also more interested in the view from this.
hexo comes with default theme is landscape, then spent a time on the topic, had finally selected yilia, because Baidu out a lot of this tutorial, then read several pv uv vv in this article how to get tangled, and we used more He said the comment was found not integrated.
Then search for the related programs, suddenly discover next, there is also the official website, better integrated, so immediately turned to his arms, is to write articles, do not want too much to toss, so the following tutorial begins.

Installation nodejs install git

I note here is carried out under the windows user

Software installation is not in the details described. Generally the default installation, replaced most installation path must choose which to install npm, checked by default when you install node. When you install git, are generally installed by default, git is integrated by msys

Cmd to open the address bar enter cmd in the search box, enter cmd to open a directory or you can also prompt more intelligent with the windows poweshell

node version verification

      
      
1
2
      
      
$ Node -v
v6.10.0

npm version

      
      
1
2
      
      
$ Asl -v
3.10.10

git version

      
      
1
2
      
      
$ git --version
git version 2.11.0.windows.1

If you have tips above indicate a successful installation, If not, generally environmental variables, specific issues, specific solutions.

Installation and hexo next topic

1. Install hexo

       
       
1
2
       
       
$ npm install hexo-cli -g
Npm install HEXO-util $ -g # installation hexo-util next topic need to use

2. Verify hexo

       
       
1
2
3
4
5
6
7
8
9
10
11
12
       
       
$ Hexo- -v
hexo-cli: 1.0.2
os: Windows_NT 10.0.14393 win32 x64
http_parser: 2.7.0
node: 6.10.0
v8: 5.1.281.93
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 58.2
modules: 48
openssl: 1.0.2k

3. Create blog

       
       
1
2
3
4
5
6
       
       
$ Cd ~ / myblog # ~ represents the current directory you can create your favorite directory, then cmd to navigate to the directory.
$ Hexo init # initialization, clears the entire directory with caution
$ Npm install to install the required dependencies
$ hexo server # 可以简化为hexo s 有下面信息这表示启动ok
INFO Start processing
INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

然后地址栏输入http://localhost:4000/ 即可看到一个初始化页面

4.主题的应用

       
       
1
       
       
$ git clone https://github.com/iissnan/hexo-theme-next themes/next

一个是根目录下的hexo的_config.yml文件,一个是根目录/themes/next 主题文件的_config.yml文件,请注意区分
这种以yml结尾的配置文件,是yaml格式的配置文件格式,相应的有toml,json,xml,ini等

修改hexo的_config.yml文件

  • site部分下 language: zh-Hans 其他选项请自己更改
  • Extensions部分下 theme: next 表示使用themes下的next主题

修改next主题文件的_config.yml文件

然后 Ctrl+C 关闭先前的,然后重新运行 hexo s
然后刷新页面 就能看见新主题页面这里我的

原文:大专栏  第一篇博客,hexo的安装


Guess you like

Origin www.cnblogs.com/chinatrump/p/11597135.html