標(biāo)簽插件和 Front-matter 中的標(biāo)簽不同,它們是用于在文章中快速插入特定內(nèi)容的插件。
在文章中插入引言,可包含作者、來(lái)源和標(biāo)題。
捷徑: quote
{% blockquote [author[, source]] [link] [source_link_title] %}
content
{% endblockquote %}
沒(méi)有提供參數(shù),則只輸出普通的 blockquote
{% blockquote %}
Lo
{% 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.
引用書(shū)上的句子
{% 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:
NEW: DevDocs now comes with syntax highlighting. http:
{% endblockquote %}
NEW: DevDocs now comes with syntax highlighting. http://devdocs.io
@DevDocs[twitter.com/devdocs/status/356095192085962752](https://twitter.com/devdocs/status/356095192085962752)
引用網(wǎng)路上的文章
{% 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.
Seth Godin[Welcome to Island Marketing](http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html)
在文章中插入代碼。
快捷方式: code
{% codeblock [title] [lang:language] [url] [link text] %}
code snippet
{% endcodeblock %}
普通的代碼塊
{% codeblock %}
alert('Hello World!');
{% endcodeblock %}
alert('Hello World!');
指定語(yǔ)言
{% codeblock lang:objc %}
[rectangle setX: 10 y: 10 width: 20 height: 20];
{% endcodeblock %}
[rectangle setX: 10 y: 10 width: 20 height: 20];
附加說(shuō)明
{% codeblock Array.map %}
array.map(callback[, thisArg])
{% endcodeblock %}
Array.map
array.map(callback[, thisArg])
附加說(shuō)明和網(wǎng)址
{% codeblock _.compact http://underscorejs.org/
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]
{% endcodeblock %}
_.compact[Underscore.js][3]
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]
另一種形式的代碼塊。
<!--?10-->
在文章中插入 Pull quote。
{% pullquote [class] %}
content
{% endpullquote %}
在文章中嵌入 jsFiddle。
{% jsfiddle shorttag [tabs] [skin] [width] [height] %}
在文章中嵌入 Gist。
{% gist gist_id [filename] %}
在文章中插入 iframe。
{% iframe url [width] [height] %}
在文章中插入指定大小的圖片。
{% img [class names] /path/to/image [width] [height] [title text [alt text]] %}
在文章中插入鏈接,并自動(dòng)給外部鏈接添加 target="_blank" 屬性。
{% link text url [external] [title] %}
插入 source 文件夾內(nèi)的代碼文件。
{% include_code [title] [lang:language] path/to/file %}
在文章中插入 Youtube 視頻。
{% youtube video_id %}
在文章中插入 Vimeo 視頻。
{% vimeo video_id %}
引用其他文章的鏈接。
{% post_path slug %}
{% post_link slug [title] %}
引用文章的資源。
{% asset_path slug %}
{% asset_img slug [title] %}
{% asset_link slug [title] %}
如果您想在文章中插入 Swig 標(biāo)簽,可以嘗試使用 Raw 標(biāo)簽,以免發(fā)生解析異常。
{% raw %}
content
{% endraw %}