hexo-note

Hexo

快速、简洁且高效的博客架构

使用 Markdown 解析文章

基于 Node.js 框架

安装

1
$ npm install hexo

使用

1
$ npx hexo <command>

网页框架初始化

是网页框架的主文件夹名

1
2
3
$ hexo init <folder>
$ cd <folder>
$ npm install

初始化的文件结构

1
2
3
4
5
6
7
8
.
├── _config.yml
├── package.json
├── scaffolds
├── source
| ├── _drafts
| └── _posts
└── themes
  • _config.yml
    • 网站配置文件
  • package.json
    • 应用程序信息
  • scaffolds
    • 模板 文件夹,新建文章时,Hexo根据该模板创建文件
  • source
    • 资源文件夹。存放用户资源。除 _posts 文件夹外,其它以 下划线_ 开始的文件都将被忽略。
    • Markdown 和 HTML 文件会被解析并放到 public 文件夹,其他的文件将被拷贝至该目标。
  • theme
    • 主题文件夹。Hexo根据主题生成静态文件。

_config.yml 网页配置文件

生成

1
$ hexo g

本地布署

1
$ hexo s

上传

  • 在 _config.yml 配置文件中的最后的deploy部分
1
2
3
4
deploy:
type: git
repository: git@github.com:<user_name>/<repository_name>.git
branch: main
  • 上传指令
1
$ hexo d

主题

首先,可以使用 git 拉取开源主题仓库 或 npm 下载主题

然后,在 _config.yml 配置文件中包含一个 theme 字段(默认为 landscape),将该字段更改为所选主题的名字。