Tag Plugins

태그 플러그인은 포스트의 태그와는 다릅니다. Octopress로부터 가져온 것으로 특별한 컨텐츠를 당신의 포스트에 빠르게 추가할 수 있도록 도와주는 유용한 방법입니다.

Although you can write your posts in any formats, but the tag plugins will always be available and syntax remains the same.

Tag plugins should not be wrapped inside Markdown syntax, e.g. []({% post_path lorem-ipsum %}) is not supported.

Block Quote

인용구를 post, 소스, 제목에 추가하기 위한 완벽한 방법입니다. 옵션으로 인용구의 원작자를 추가할 수도 있습니다.

Alias: quote

{% blockquote [author[, source]] [link] [source_link_title] %}
content
{% endblockquote %}

예시

인자가 없는 일반 인용

{% 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.

책 인용하기

{% 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

Twitter 인용하기

{% blockquote @DevDocs https://twitter.com/devdocs/status/356095192085962752 %}
NEW: DevDocs now comes with syntax highlighting. http://devdocs.io
{% endblockquote %}

NEW: DevDocs now comes with syntax highlighting. http://devdocs.io

웹 게시물 인용하기

{% blockquote Seth Godin http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html Welcome to Island Marketing %}
Every interaction is both precious and an opportunity to delight.
{% endblockquote %}

Every interaction is both precious and an opportunity to delight.

Code Block

코드 조각(snippet)을 포스트에 추가할 수 있는 유용한 기능입니다.

Alias: code

{% codeblock [title] [lang:language] [url] [link text] [additional options] %}
code snippet
{% endcodeblock %}

Specify additional options in option:value format, e.g. line_number:false first_line:5.

Extra Options Description Default
line_number Show line number true
line_threshold Only show line numbers as long as the numbers of lines of the code block exceed such threshold. 0
highlight Enable code highlighting true
first_line Specify the first line number 1
mark Line highlight specific line(s), each value separated by a comma. Specify number range using a dash
Example: mark:1,4-7,10 will mark line 1, 4 to 7 and 10.
wrap Wrap the code block in <table> true

예시

일반 code block 사용하기

{% codeblock %}
alert('Hello World!');
{% endcodeblock %}
alert('Hello World!');

언어 지정하기

{% codeblock lang:objc %}
[rectangle setX: 10 y: 10 width: 20 height: 20];
{% endcodeblock %}
[rectangle setX: 10 y: 10 width: 20 height: 20];

Code block에 제목 넣기

{% codeblock Array.map %}
array.map(callback[, thisArg])
{% endcodeblock %}
Array.map
array.map(callback[, thisArg])

제목과 URL 넣기

{% codeblock _.compact http://underscorejs.org/#compact Underscore.js %}
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]
{% endcodeblock %}
_.compactUnderscore.js
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]

Backtick Code Block

이 방법은 code block을 사용하는 것과 같습니다만 block을 구분하기 위해 세 개의 역 따옴표를 사용하는 점이 다릅니다.

``` [language] [title] [url] [link text] code snippet ```

Pull Quote

pull 인용을 추가하기 위한 방법은 다음과 같습니다.

{% pullquote [class] %}
content
{% endpullquote %}

jsFiddle

jsFiddle을 포함시킬 수 있습니다.

{% jsfiddle shorttag [tabs] [skin] [width] [height] %}

Gist

Gist를 포함시킬 수 있습니다.

{% gist gist_id [filename] %}

iframe

iframe을 포함시킬 수 있습니다.

{% iframe url [width] [height] %}

Image

이미지의 사이즈를 지정하여 포함시킬 수 있습니다.

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

Link

target="_blank" 속성으로 링크를 포함시킬 수 있습니다.

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

Include Code

source/downloads/code 폴더에 있는 코드를 포함시킬 수 있습니다.

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

YouTube

YouTube video를 포함시킬 수 있습니다.

{% youtube video_id [type] [cookie] %}

Examples

Embed a video

{% youtube lJIrF4YjHfQ %}

Embed a playlist

{% youtube PL9hW1uS6HUfscJ9DHkOSoOX45MjXduUxo 'playlist' %}

Enable privacy-enhanced mode

YouTube’s cookie is not used in this mode.

{% youtube lJIrF4YjHfQ 'video' false %}
{% youtube PL9hW1uS6HUfscJ9DHkOSoOX45MjXduUxo 'playlist' false %}

Vimeo

Vimeo video를 포함시킬 수 있습니다.

{% vimeo video_id %}

Include Posts

다른 포스트의 링크를 포함시킬 수 있습니다.

{% post_path filename %}
{% post_link filename [title] [escape] %}

You can ignore permalink and folder information, like languages and dates, when using this tag.

For instance: {% post_link how-to-bake-a-cake %}.

This will work as long as the filename of the post is how-to-bake-a-cake.md, even if the post is located at source/posts/2015-02-my-family-holiday and has permalink 2018/en/how-to-bake-a-cake.

You can customize the text to display, instead of displaying the post’s title.

Post’s title and custom text are escaped by default. You can use the escape option to disable escaping.

For instance:

Display title of the post.

{% post_link hexo-3-8-released %}

Hexo 3.8.0 Released

Display custom text.

{% post_link hexo-3-8-released 'Link to a post' %}

Link to a post

Escape title.

{% post_link hexo-4-released 'How to use <b> tag in title' %}
How to use <b> tag in title

Do not escape title.

{% post_link hexo-4-released '<b>bold</b> custom title' false %}
bold custom title

Include Assets

포스트의 asset을 포함시킬 수 있습니다.

{% asset_path filename %}
{% asset_img [class names] slug [width] [height] [title text [alt text]] %}
{% asset_link filename [title] [escape] %}

Embed image

hexo-renderer-marked 3.1.0+ can (optionally) resolves the post’s path of an image automatically, refer to this section on how to enable it.

“foo.jpg” is located at http://example.com/2020/01/02/hello/foo.jpg.

Default (no option)

{% asset_img foo.jpg %}

<img src="/2020/01/02/hello/foo.jpg">

Custom class

{% asset_img post-image foo.jpg %}

<img src="/2020/01/02/hello/foo.jpg" class="post-image">

Display size

{% asset_img foo.jpg 500 400 %}

<img src="/2020/01/02/hello/foo.jpg" width="500" height="400">

Title & Alt

{% asset_img logo.svg "lorem ipsum'dolor'" %}

<img src="/2020/01/02/hello/foo.jpg" title="lorem ipsum" alt="dolor">

Raw

특정 컨텐츠가 당신의 포스트 내에서 문제를 일으킨다면, raw 태그를 사용하여 감싸주세요. 그러면 렌더링 에러를 피할 수 있습니다.

{% raw %}
content
{% endraw %}