Read this before, it assumes that the reader has been Node.js
based, such as the need to add Node.js
knowledge, your own Baidu.
Hexo
Is Node.js
a project under the framework, the use of Node.js
the power supplied to convert from Markdown to static pages.
NexT theme is a plug-in Hexo project to provide highly customized appearance of the page.
1. What we need to do
- Set up Node.js environment
- Download Hexo project
- Download NexT theme plugin
- Run blog
2. Install the Windows systemNode.js
Under Windows, Node.js
the core is a command-line executable file Node.exe
. Whether or install version green version, as long as the following two basic conditions are met, Hexo
you can run.
node.exe
In the command line console of the current folder, or the system environment variables canpath
be found.Node.js
Related toolkits (such asnpm
, in fact, Windows script filesnpm.cmd
) on the command line console of the current folder or system environment variables can bepath
found.
Note : npm
a Node.js
built-in module package management tool, with node.exe
the same folder. Hexo
The project also provides a command-line tool hexo.cmd
. This project is shared by all instances, Hexo
should generally be installed globally. It's hexo.cmd
where the folder should be placed in the system path
variable.
Install Node.js
The above information is sufficient for Windows old drivers. Old drivers, please skip the rest of this.
Download from http://nodejs.cn/download/ 32 or 64 zip archive version, it is recommended to install long-term support version.
Unzip the download package you want to install the folder, for example
D:\DevelopTools\Nodejs\
.Optionally one embodiment following the
Node.exe
path into the systempath
variable. Modifypath
the variables, only take effect in the new command window that opens.Use
setx
the commandsetx PATH "%PATH%;D:\DevelopTools\Nodejs\;" /M
Modify the registry directly
Use Registry Editor opens
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
inpath
an additional after variable;D:\DevelopTools\Nodejs\;
.In
我的电脑
the right click and select Properties, selection高级系统设置
, selection高级
, select系统变量
, inpath
adding the route variables.
- In any manner provided the following global package mounting position, which position is assumed
d:\node_global
.- With the
npm
commandnpm config set prefix ="d:\node_global"
. - Directly open
C:\Users\Administrator\.npmrc
files, add or modify themprefix=d:\node_global
.
- With the
Referring to the embodiment 3 of the installation path Node.js global packet
d:\node_global
into the systempath
variable.Run
node -v
andnpm -v
show the normal version of the installation is complete.
Supplementary : domestic environment to package a remote server as Taobao mirror to speed up the download speed.
- Use the command line to run
npm config set registry=https://registry.npm.taobao.org/
. - Or, just modify the
C:\Users\Administrator\.npmrc
file, add a lineregistry=https://registry.npm.taobao.org/
.
3. Install or download Hexo project
The official recommended npm
for installation.
npm install hexo-cli -g
The above command will hexo.cmd
install the package to the global repository, as the repository folder in the Windows system path
in. So you can perform at any position hexo
commands.
Execute the following command to confirm hexo
installation intact.
hexo -v
This command displays the hexo
version and dependent packages.
4. Install or download NexT theme plugin
By git
instructions to download NexT
the latest theme file.
git clone https://github.com/iissnan/hexo-theme-next themes/next
Or directly from the publisher page https://github.com/iissnan/hexo-theme-next/releases download the source specified version of the source code.
Assets 2
After the download, unzip the theme theme file and put it in themes
the theme file
+---public
| +---about
| +---archives
| +---categories
| +---css
| +---images
| +---js
| +---lib
| +---page
| +---post
| \---tags
+---scaffolds
+---source
| +---about
| +---categories
| +---images
| +---tags
| +---_drafts
| \---_posts
\---themes
\---next
+---languages
+---layout
+---scripts
+---source
| +---css
| +---fonts
| +---images
| +---js
In the site configuration file _config.yml
inside, find it
# 原来的值是landscape
theme: next
5. Create and run blog
Create an empty folder, as the blog root directory, in the root directory, blog initialization
hexo init
The theme files are copied to the blog file
theme
belowExecute
Hexo
server commands provided.hexo serve
The console displays:
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
In the browser address bar enter inside http://localhost:4000
, you can access the blog.
Important information
This article used version of the project
hexo:3.8.0
NexT:5.1.2