> For the complete documentation index, see [llms.txt](https://hexo.course.90byte.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hexo.course.90byte.com/mu-lu/index/3.-chu-shi-hua.md).

# 1.3 初始化

大致了解了一下Hexo的一些命令，下面就开始着手搭建Blog框架了。

## 初始项目

三条命令初始化一个Hexo项目：

```bash
# 创建Blog目录及基本文件
hexo init Blog
# 进入Blog目录
cd Blog
# 安装Hexo项目的基础插件，存放在node_modules目录下
npm install
```

## 了解项目目录

初始化完之后，就能看到一个基本Hexo项目的结构了

```
Blog
├── _config.yml
├── package.json
├── scaffolds
├── source
|   ├── _drafts
|   └── _posts
├── themes
|   └──landscape
└── node_modules
```

* `_config.yml` Hexo基本配置参数文件
* `package.json` Node项目基本信息，包括名称，作者，以及一些一些依赖包信息等等，有它方便更快重建项目；
* `scaffolds` 模版文件；
* `source` 资源库，文章相关资源存放的地方；
  * `_drafts` 草稿
  * `_posts` 正式发表的文章
* `themes` 主题目录
  * `landscape` Hexo目前默认主题
* `node_modules` node模块，存放的是依赖的相关插件

## 运行博客项目

在博客根目录下，运行命令`hexo s`，启动Hexo的本地服务，就会看到下述的提示。

```
$ hexo s
INFO  Start processing
INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
```

上述提示，Hexo项目已经运行在`http://localhost:4000`下，本地浏览器打开，输入`http://localhost:4000`，就能看到博客的首页了。
