在hexo及MarkDown中添加html、jss等代码段的方法

这种方法整理来自hexo官网


标签插件(Tag Plugins)

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

###引用块
在文章中插入引言,可包含作者、来源和标题。
别号: 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

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.
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 snippetPull Quote
在文章中插入 Pull quote。

content

jsFiddle
在文章中嵌入 jsFiddle。

Gist
在文章中嵌入 Gist。

iframe
在文章中插入 iframe。

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

Link
在文章中插入链接,并自动给外部链接添加 target=”_blank”
属性。
text url [external] [title]

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

Youtube
在文章中插入 Youtube 视频。

Vimeo
在文章中插入 Vimeo 视频。

引用文章
引用其他文章的链接。

引用资源
引用文章的资源。


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

Yodes Yang wechat
扫描二维码与我联系

------ 本文结束 ------
  • 本文作者: Yodes Yang
  • 文章标题: 在hexo及MarkDown中添加html、jss等代码段的方法
  • 发布时间: 2016年8月12日 - 11时08分
  • 本文链接: http://blog.yodes.cn/post/dea0.html
  • 版权声明: 本博客所有文章除特别声明外,均采用 许可协议。转载请注明出处!
扫二维码
扫一扫,用手机访问本站

扫一扫,用手机访问本站