HEXO GUIDE

HEXO头操作

分类文章\文章标签

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
并列分类,了解一下:
categories:
- [Linux]
- [Tools]

并列+子分类,再了解一下:
categories:
- [Linux, Hexo]
- [Tools, PHP]

categories:
- Diary
tags:
- PS3
- Games

归档文章

如果只是想让文章在首页隐藏,但仍需要在归档分类页里展示,可以在文章开头 front-matter (opens new window)中配置 archive: true 属性。

1
2
3
4
5
6
7
---
title: 文章标题
index_img: /img/example.jpg
date: 2019-10-10 10:00:00
archive: true
---
以下是文章内容

文章排序

如果想手动将某些文章固定在首页靠前的位置,可以在安装 hexo-generator-index >= 2.0.0 版本的情况下,在文章开头 front-matter (opens new window)中配置 sticky 属性:

1
2
3
4
5
6
7
---
title: 文章标题
index_img: /img/example.jpg
date: 2019-10-10 10:00:00
sticky: 100
---
以下是文章内容

sticky 数值越大,该文章越靠前,达到类似于置顶的效果,其他未设置的文章依然按默认排序。

文章在首页的封面图

对于单篇文章,在文章开头 front-matter (opens new window)中配置 index_img 属性。

1
2
3
4
5
6
7
---
title: 文章标题
tags: [Hexo, Fluid]
index_img: /img/example.jpg
date: 2019-10-10 10:00:00
---
以下是文章内容

和 Banner 配置相同,/img/example.jpg 对应的是存放在 /source/img/example.jpg 目录下的图片(目录也可自定义,但必须在 source 目录下)。

也可以使用外链 Url 的绝对路径。

如果想统一给文章设置一个默认图片(文章不设置 index_img 则默认使用这张图片),可在主题配置中设置:

1
2
post:
default_index_img: /images/example.jpeg

default_index_imgindex_img 都为空时,该文章在首页将不显示图片。

文章页顶部大图

默认显示主题配置中的 post.banner_img,如需要设置单个文章的 Banner,在 front-matter (opens new window)中指定 banner_img 属性。

本地图片存放位置同上。

1
2
3
4
5
6
7
8
---
title: 文章标题
tags: [Hexo, Fluid]
index_img: /img/example.jpg
banner_img: /img/post_banner.jpg
date: 2019-10-10 10:00:00
---
以下是文章内容

Tag 插件

#便签

在 markdown 中加入如下的代码来使用便签:

1
2
3
{% note success %}
文字 或者 `markdown` 均可
{% endnote %}

或者使用 HTML 形式:

1
<p class="note note-primary">标签</p>

可选便签:

标签

行内标签

在 markdown 中加入如下的代码来使用 Label:

1
{% label primary @text %}

或者使用 HTML 形式:

1
<span class="label label-primary">Label</span>

可选 Label:

primary default info success warning danger

折叠块

使用折叠块,可以折叠代码、图片、文字等任何内容,你可以在 markdown 中按如下格式:

1
2
3
{% fold info @title %}
需要折叠的一段内容,支持 markdown
{% endfold %}

info: 和行内标签类似的可选参数 title: 折叠块上的标题

勾选框

在 markdown 中加入如下的代码来使用 Checkbox:

1
{% cb text, checked?, incline? %}

text:显示的文字
checked:默认是否已勾选,默认 false
incline: 是否内联(可以理解为后面的文字是否换行),默认 false

示例:

普通示例
默认选中
内联示例 后面文字不换行 也可以只传入一个参数,文字写在后边(这样不支持外联)

按钮

你可以在 markdown 中加入如下的代码来使用 Button:

1
{% btn url, text, title %}

或者使用 HTML 形式:

1
<a class="btn" href="url" title="title">text</a>

url:跳转链接
text:显示的文字
title:鼠标悬停时显示的文字(可选)

text

组图

如果想把多张图片按一定布局组合显示,你可以在 markdown 中按如下格式:

1
2
3
4
5
6
7
{% gi total n1-n2-... %}
![](url)
![](url)
![](url)
![](url)
![](url)
{% endgi %}

total:图片总数量,对应中间包含的图片 url 数量
n1-n2-…:每行的图片数量,可以省略,默认单行最多 3 张图,求和必须相等于 total,否则按默认样式

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.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

*其余没有数字的为杂项,由标签分类

0-论文.md

基本格式:

h2论文标题

h3背景

h3实验方法

h3实验结果

h3结论

*h3代码分析

1-基础部分.md

2-工具与软件.md

3-机器学习.md

4-.

5-

C-代码分析.md

基本格式:

h2论文标题

h3背景

h3实验方法

h3代码分析