写作

1.模板

文件夹/scaffolds/ 下配置相对应布局的模板

2.格式

Hexo 支持以任何格式书写文章,只要安装了相应的渲染插件。

例如,Hexo 默认安装了 hexo-renderer-markedhexo-renderer-ejs,因此你不仅可以用 Markdown 写作,你还可以用 EJS 写作。如果你安装了 hexo-renderer-pug,你甚至可以用 Pug 模板语言书写文章。

只需要将文章的扩展名从 md 改成 ejs,Hexo 就会使用 hexo-renderer-ejs 渲染这个文件,其他格式同理。

3.分类和标签

分类具有顺序性和层次性

阅读全文 »

插件hexo-migrator-rss

安装

1
$ npm install hexo-migrator-rss --save

使用

从RSS迁移文章

1
hexo migrate rss <source>

source 是文件路径或网址

感觉自己用不上,就算了

阅读全文 »

标题

1级标题

2级标题

3级标题

四级标题

五级标题
六级标题

直接输入1次#,并按下space后,将生成1级标题。
输入2次#,并按下space后,将生成2级标题。
以此类推,我们支持6级标题。有助于使用TOC语法后生成一个完美的目录。

文本样式

阅读全文 »

插件hexo-admin

hexo-admin:用于管理文章

1.安装

1
npm install hexo-admin --save

2.使用

浏览器输入(端口为自己配置的端口)

1
http://localhost:4000/admin

3.设置

3.1设置密码

阅读全文 »

基本配置

文件夹目录

1
2
3
4
5
6
7
8
.
├── _config.yml
├── package.json
├── scaffolds
├── source
| ├── _drafts
| └── _posts
└── themes

1._config.yml

网站的 配置 信息,您可以在此配置大部分的参数。

1.1 网站相关

参数 描述
title 网站标题
subtitle 网站副标题
description 网站描述,与搜索引擎相关,网站关键词
author 您的名字
language 网站使用的语言 参考:zh-Hans,zh-CN
timezone 网站时区。Hexo 默认使用您电脑的时区。时区列表。比如说:America/New_York, Japan, 和 UTC 。参考:’Asia/Shanghai’

1.2 网址

参数 描述
url 网址,写github地址
root 网站根目录
permalink 文章的 永久链接 格式
permalink_defaults 永久链接中各部分的默认值
阅读全文 »

托管方式

1.github

找到根目录下的 _config.yml文件(格式要写对)

1
2
3
4
5
6
deploy:
type: git
repository:
github: 地址
coding: 地址
branch: master

hexo -d 上传代码

错误:ERROR Deployer not found: git

1
npm install hexo-deployer-git --save

项目仓库选择设置,左侧选择page

完后就可以看见访问地址了

阅读全文 »

本地搭建hexo

1.安装node

1
2
3
4
$ node -v
v14.17.0
$ npm -v
7.20.0

2.安装git

省略

3.初始化hexo

进入想要部署hexo的目录,右键打开Git Bash here

1
2
3
$npm install -g hexo

$ hexo init

版本查询

阅读全文 »

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

欢迎来到Hexo! 这是你的第一篇文章。检查文件更多信息。如果您在使用Hexo时遇到任何问题,您可以在[故障排除]中找到答案

Quick Start快速启动

Create a new post创建新帖子

1
$ hexo new "My New Post"

More info: Writing更多信息:

Run server运行服务器

1
$ hexo server

More info: Server更多信息:

阅读全文 »