# 標簽插件(Tag Plugins)
標簽插件和 Front-matter 中的標簽不同,它們是用于在文章中快速插入特定內容的插件。
## 引用塊
在文章中插入引言,可包含作者、來源和標題。
**別號:** quote
```
{% blockquote [author[, source]] [link] [source_link_title] %}
content
{% endblockquote %}
```
### 樣例
**沒有提供參數,則只輸出普通的 blockquote**
```
{% 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.
>
> <footer>**David Levithan**<cite>Wide Awake</cite></footer>
**引用 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](http://devdocs.io)
>
> <footer>**@DevDocs**<cite>[twitter.com/devdocs/status/356095192085962752](https://twitter.com/devdocs/status/356095192085962752)</cite></footer>
**引用網絡上的文章**
```
{% 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.
>
> <footer>**Seth Godin**<cite>[Welcome to Island Marketing](http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html)</cite></footer>
## 代碼塊
在文章中插入代碼。
**別名:** 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: 10102020
```
**附加說明**
```
{% codeblock Array.map %}
array.map(callback[, thisArg])
{% endcodeblock %}
```
```
array.map(callback[, thisArg])
```
**附加說明和網址**
```
{% codeblock _.compact http://underscorejs.org/#compact Underscore.js %}
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]
{% endcodeblock %}
```
[Underscore.js](http://underscorejs.org/#compact)
```
_.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] %}
```
## Image
在文章中插入指定大小的圖片。
```
{% img [class names] /path/to/image [width] [height] [title text [alt text]] %}
```
## Link
在文章中插入鏈接,并自動給外部鏈接添加 `target="_blank"` 屬性。
```
{% link text url [external] [title] %}
```
## Include Code
插入 `source` 文件夾內的代碼文件。
```
{% include_code [title] [lang:language] path/to/file %}
```
## Youtube
在文章中插入 Youtube 視頻。
```
{% youtube video_id %}
```
## Vimeo
在文章中插入 Vimeo 視頻。
```
{% vimeo video_id %}
```
## 引用文章
引用其他文章的鏈接。
```
{% post_path slug %}
{% post_link slug [title] %}
```
## 引用資源
引用文章的資源。
```
{% asset_path slug %}
{% asset_img slug [title] %}
{% asset_link slug [title] %}
```
## Raw
如果您想在文章中插入 Swig 標簽,可以嘗試使用 Raw 標簽,以免發生解析異常。
```
{% raw %}
content
{% endraw %}
```
- 文檔
- 開始使用
- 概述
- 建站
- 配置
- 指令
- 遷移
- 基本操作
- 寫作
- Front-matter
- 標簽插件(Tag Plugins)
- 資源文件夾
- 數據文件
- 服務器
- 生成文件
- 部署
- 自定義
- 永久鏈接(Permalinks)
- 主題
- 模版
- 變量
- 輔助函數(Helpers)
- 國際化(i18n)
- 插件
- 其他
- 問題解答
- 貢獻
- API
- 核心
- 概述
- 事件
- 局部變量
- 路由
- Box
- 渲染
- 文章
- 腳手架(Scaffold)
- 主題
- 擴展
- 控制臺(Console)
- 部署器(Deployer)
- 過濾器(Filter)
- 生成器(Generator)
- 輔助函數(Helper)
- 遷移器(Migrator)
- 處理器(Processor)
- 渲染引擎(Renderer)
- 標簽插件(Tag)