标签插件

标签插件与文章中的标签是不同的。他们是从 Octopress 移植过来可以帮助你在文章中插入具体的内容。

区块引用

插入引用到文章中,连同作者、来源以及标题。

别名: quote

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

例子

没有参数,输出块引用

{% blockquote %}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque hendrerit lacus ut purus iaculis feugiat. Sed nec tempor elit, quis aliquam neque. Curabitur sed diam eget dolor fermentum semper at eu lorem.
{% endblockquote %}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque hendrerit lacus ut purus iaculis feugiat. Sed nec tempor elit, quis aliquam neque. Curabitur sed diam eget dolor fermentum semper at eu lorem.

引用一本书中的段落

{% blockquote David Levithan, Wide Awake %}
Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy.
{% endblockquote %}

Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy.

David LevithanWide Awake

引用 Twitter 内容

{% blockquote @DevDocs https://twitter.com/devdocs/status/356095192085962752 %}
NEW: DevDocs now comes with syntax highlighting. http://devdocs.io
{% endblockquote %}

NEW: DevDocs now comes with syntax highlighting. http://devdocs.io

引用网上的一篇文章

{% blockquote Seth Godin http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html Welcome to Island Marketing %}
Every interaction is both precious and an opportunity to delight.
{% endblockquote %}

Every interaction is both precious and an opportunity to delight.

代码块

在文章中插入代码块

别名: code

{% codeblock [title] [lang:language] [url] [link text] %}
code snippet
{% endcodeblock %}

例子

一般的代码块

{% codeblock %}
alert(‘Hello World!’);
{% endcodeblock %}
alert('Hello World!');

指定语言的代码块

{% codeblock lang:objc %}
[rectangle setX: 10 y: 10 width: 20 height: 20];
{% endcodeblock %}
[rectangle setX: 10 y: 10 width: 20 height: 20];

带标题的代码块

{% codeblock Array.map %}
array.map(callback[, thisArg])
{% endcodeblock %}
Array.map
array.map(callback[, thisArg])

带 URL 的代码块

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

反引号代码块

这个插件是一个类似的代码块,只是使用单引号样式。

``` [language] [title] [url] [link text]
code snippet
```

Pull Quote

这个插件帮助你在文章中插入一个 pull quote。

{% pullquote [class] %}
content
{% endpullquote %}

jsFiddle

在文章中嵌入一段 jsFiddle 片段。

{% jsfiddle shorttag [tabs] [skin] [width] [height] %}

Gist

在文章中嵌入一段 Gist 片段。

{% gist gist_id [filename] %}

iframe

在文章中嵌入 iframe 片段。

{% iframe url [width] [height] %}

图片

在文章中插入指定大小的图片。

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

链接

插入一个包含 target="_blank" 属性的链接。

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

包含代码

插入 source 文件夹中的代码片段。

{% include_code [title] [lang:language] path/to/file %}

Youtube

在文章中插入一个 Youtube 视频。

{% youtube video_id %}

Vimeo

在文章中插入一个 Vimeo 视频。

{% vimeo video_id %}

原始内容

如果你不想让一些内容被处理,你可以用 rawblock 标签包裹。

{% rawblock %}
content
{% endrawblock /%}