HEXO文章中的标签引用 by L0st

2018-11-02  本文已影响0人  l0st

引用块

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

{% blockquote [author[, source]] [link] [source_link_title] %}
content
{% endblockquote %}
  1. 没有提供参数,则只输出普通的blockquote
{% 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.
{% 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.

  1. 引用书上的句子
{% 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

代码块

在文章中插入代码

{% codeblock [title] [lang:language] [url] [link text] %}
code snippet
{% endcodeblock %}
  1. 普通的代码块
{% codeblock %}
alert('Hello World!');
{% endcodeblock %}

alert('Hello World!');

  1. 指定语言
{% codeblock lang:objc %}
[rectangle setX: 10 y: 10 width: 20 height: 20];
{% endcodeblock %}

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

其他常用的标签

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

{% img [class names] /path/to/image [width] [height] [title text [alt text]] %}

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

{% link text url [external] [title] %}

插入source文件夹中的代码文件

{% include_code [title] [lang:language] path/to/file %}

文章中插入Youtube视频

{% youtube video_id %}
上一篇 下一篇

猜你喜欢

热点阅读