HEXO文章中的标签引用 by 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 %}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容