# 建站经历

## 域名解析 与 主机绑定域名

域名解析：在域名设置中配置改域名解析到哪一个ip 主机绑定域名：在主机的中也可以设置该机器绑定哪个域名的请求，传统的建站用云虚拟主机会有专门的域名绑定设置页面，而如果你使用的是ecs等云服务器，则可以自己配置域名绑定，比如使用nginx来配置 [nginx绑定域名](https://github.com/othorizon/DarkTime/tree/c9a19694fd98220f3ae450eeae2b136c4dcc9beb/nginx/nginx域名绑定.md)

## hexo 建站

[更换博客系统——从jekyll到hexo - Just For Fun - SegmentFault 思否](https://segmentfault.com/a/1190000002398039?_ea=409056) [使用Hexo+Github一步步搭建属于自己的博客（基础） - Z皓 - 博客园](https://www.cnblogs.com/fengxiongZz/p/7707219.html)

## 注意事项

`source`目录下的文件会被部署到git下，所以像CNAME、favicon.ico等放到`source`目录下就好了

## hexo命令

`hexo new [layout] <title>`

`hexo generate` `hexo g` -d, --deploy 文件生成后立即部署网站 -w, --watch 监视文件变动

`hexo deploy` `hexo d` -g, --generate 部署之前预先生成静态文件

`hexo g -d` `hexo d -g` 生成并部署

`hexo publish [layout] <filename>`

`hexo server` -p, --port 重设端口 -s, --static 只使用静态文件 -l, --log 启动日记记录，使用覆盖记录格式

`hexo clean` 清除缓存文件 (db.json) 和已生成的静态文件 (public)。

### 主题

[NexT 使用文档](http://theme-next.iissnan.com/)

### 插件

[Gitment：使用 GitHub Issues 搭建评论系统](https://imsun.net/posts/gitment-introduction/) [hexo next主题集成gitment评论系统 - CSDN博客](http://blog.csdn.net/yanzi1225627/article/details/77890414)

## 利用 git hook 实现自动化部署

TODO 待整理

[使用Git Hook自动部署Hexo到个人VPS](https://www.liuxinggang.com/2016-06-17-使用Git-Hook自动部署Hexo到个人VPS/)

[将hexo部署到腾讯云上](http://www.qiuqingyu.cn/2017/03/23/将hexo部署到腾讯云上/)

[git利用post-receive自动化部署 - 立二拆四 - SegmentFault 思否](https://segmentfault.com/a/1190000010185734)

git --bare 裸库 [git利用post-receive自动化部署 - 立二拆四 - SegmentFault 思否](https://segmentfault.com/a/1190000010185734)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.rizon.top/xue-xi-bi-ji/jian-zhan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
