Hexo文章写作标签技巧

标签插件(Tag Plugins)

标签插件和 Front-matter 中的标签不同,它们是用于在文章中快速插入特定内容的插件。

  • 本文只显示格式的效果,实际代码请看文末的原文链接
  • 修改完文件内容直接保存后,强制刷新页面 ctrl+F5 就可以了

    引用块

    在文章中插入引言,可包含作者、来源和标题。

别号: quote

content

[author[source]] [link] [source_link_title]

样例

没有提供参数,则只输出普通的 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.

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.

引用书上的句子

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

David LevithanWide Awake

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

David LevithanWide Awake

引用 Twitter

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

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

@DevDocstwitter.com/devdocs/status/356095192085962752

引用网络上的文章

Every interaction is both precious and an opportunity to delight.

Every interaction is both precious and an opportunity to delight.

Seth GodinWelcome to Island Marketing

代码块

在文章中插入代码。

别名: code

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

样例

普通的代码块

1
alert('Hello World!');

alert(‘Hello World!’);

指定语言

1
[rectangle setX: 10 y: 10 width: 20 height: 20];

[rectangle setX: 10 y: 10 width: 20 height: 20];

附加说明

Array.map
1
array.map(callback[, thisArg])

Array.map
array.map(callback[, thisArg])

附加说明和网址

_.compactUnderscore.js
1
2
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]

_.compactUnderscore.js
_.compact([0, 1, false, 2, ‘’, 3]);
=> [1, 2, 3]
反引号代码块
另一种形式的代码块,不同的是它使用三个反引号来包裹。

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

Pull Quote

在文章中插入 Pull quote。

content

jsFiddle

在文章中嵌入 jsFiddle。

Gist

在文章中嵌入 Gist。

iframe

在文章中插入 iframe。

Image

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

#img [class names] /path/to/image [width] [height] [title text [alt text]]

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

text url [external] [title]

Include Code

插入 source 文件夹内的代码文件。

Youtube

在文章中插入 Youtube 视频。

Vimeo

在文章中插入 Vimeo 视频。

引用文章

引用其他文章的链接。

引用资源

引用文章的资源。

Raw

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

content
  • ———————结尾分割线——————

更多内容请查看

如果我的文章对你有帮助的话欢迎打赏,嘻嘻嘻!