Hexo grammar Learning

Hexo是一款基于Node.js的静态博客框架,依赖少易于安装使用,可以方便的生成静态网页托管在GitHub和Heroku上,是搭建博客的首选框架。我的博客便是GitHub+Hexo。

引用块

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

{百分号 blockquote [author[, source]] [link] [source_link_title] 百分号} content {百分号 endblockquote 百分号}

样例:

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

David SmithChina

代码块

在文章中插入代码。

{百分号 codeblock [title] [lang:language] [url] [link text] 百分号} code snippet {百分号 endcodeblock 百分号}

样例:

测试代码
1
2
import os
print("Hello,world")

iframe

在文章中插入iframe

{百分号 iframe url [width] [height] 百分号}

样例:


Image图片

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

{百分号 img [class names] /path/to/image [width] [height] "title text 'alt text'" 百分号}"

样例:

test

Link

在文章中插入链接,并自动给外部链接添加target="_blank"属性。即在新的空白页打开链接。
{百分号 link text url [external] [title] 百分号}

样例:

dog

Include Code

插入source/downloads/code文件夹内的代码文件。该路径不是固定的,你可以在站点配置文件中code_dir修改。

{百分号 include_code [title] [lang:language] paht/to/file 百分号}

文章摘要

在文章中使用,那么该符号之前的文字将被视为摘要,在首页中将只会出现这些文字,但是注意同时正文中也会出现这些文字。