介绍MarkDown的基本语法,以及Hexo对MarkDown的扩展
原生
标题
1 2 3 4 5 6
| # //一级标题 ## //二级标题 ### //三级标题 #### //四级标题 ##### //五级标题 ###### //六级标题
|
列表
1 2 3 4
| 1. 有序列表 2. 有序列表 * 无序列表 * 无序列表
|
代码区块
代码
引用
分割线
超链接
1 2
|  [链接文字](链接URL)
|
强调
自动链接
1
| <https://blog.irember.com>
|
转义字符
针对 Hexo
引用块
在文章中插入引言,可包含作者、来源和标题(别名quote)link1 2 3
| {% blockquote [author[, source]] [link] [source_link_title] %} content {% endblockquote %}
|
代码块
在文章中插入代码(别名code)lang:markdownlink1 2 3
| {% codeblock [title] [lang:language] [url] [link text] %} code {% endcodeblock %}
|
反引号代码块
另一种形式的代码块,不同的是它使用三个反引号来包裹link1
| ``` [language] [title] [url] [link text] code snippet ```
|
Pull Quote
在文章中插入Pull quote1 2 3
| {% pullquote [class] %} content {% endpullquote %}
|
jsFiddle
在文章中嵌入jsFiddle1
| {% jsfiddle shorttag [tabs] [skin] [width] [height] %}
|
Gist
在文章中嵌入Gist1
| {% gist gist_id [filename] %}
|
iframe
在文章中插入iframe1
| {% iframe url [width] [height] %}
|
Image
在文章中插入指定大小的图片1
| {% img [class names] /path/to/image [width] [height] [title text [alt text]] %}
|
Link
在文章中插入链接,并自动给外部链接添加target=_blank属性1
| {% link text url [external] [title] %}
|
Include Code
插入source文件夹内的代码文件1
| {% include_code [title] [lang:language] path/to/file %}
|
Youtube
在文章中插入Youtube视频
Vimeo
在文章中插入Vimeo视频
引用文章
引用其他文章的链接1 2
| {% post_path slug %} {% post_link slug [title] %}
|
引用资源
引用文章的资源1 2 3
| {% asset_path slug %} {% asset_img slug [title] %} {% asset_link slug [title] %}
|
Raw
如果您想在文章中插入Swig标签,可以尝试使用Raw标签,以免发生解析异常1 2 3
| {% raw %} content {% endraw %}
|
Read More
截断文章
表格
制作表格1 2 3
| | 表头 | 表头 | 表头 | |:-----|:-----:|-----:| | 左对齐 | 居中对齐 | 右对齐 |
|
参考
Markdown 语法
Hexo Tag Plugins