封面

引用资源

1
2
3
{% asset_path 11.png %}
{% asset_img 11.png This is an example image %}
{% asset_link 11.png This is an example image %}

插入图片 Image

在文章中插入指定大小的图片(也可以用img标签实现)

1
{% img [class names] /path/to/image [width] [height] [title text [alt text]] %}

在文章中插入链接,并自动给外部链接添加 target=”_blank” 属性。

1
{% link text url [external] [title] %}

代码块

简单的写法,它使用三个或三个以上反引号来包裹。

1
2
[language] [title] [url] [link text] 
code snippet

在文章中插入代码。

1
2
3
{% codeblock [title 说明] [lang:language 指定语言(原生语法也可以指定语言)] [url 网址] [link text 连接显示的文本] %}
code snippet
{% endcodeblock %}

附加说明和网址(多了的)

1
2
3
4
{% codeblock _.compact http://underscorejs.org/#compact Underscore.js %}
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]
{% endcodeblock %

效果如下:
_.compactUnderscore.js
1
2
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]

引用块

在文章中插入引言,可包含作者、来源和标题。
(跟 > 差不多,区别在于它提供了一个标准格式,可以很方便地插入引言,可包含作者、来源和标题。)

1
2
3
{% blockquote [author[, source]] [link] [source_link_title] %}
content
{% endblockquote %}

效果如下:

content

插入 Swig 标签

如果您想在文章中插入 Swig 标签,可以尝试使用 Raw 标签,以免发生解析异常。

1
2
3
4
5
6
{% raw %}
{% set foo = [1,2,3] %}
{% for bar in foo %}
{% bar %}
{% endfor %}
{% endraw %}

博客封面图

先安装

1
npm install --save hexo-less

随后在博客文章内容下添加
1
2
3
4
5
6
7
8
9
10
11
12
---
title: 博客标题
date: 时间
categories: 分类
tags: 标签
---

![封面](http://xxxxx.jpeg)

<!--less-->

这部分为 Content.....