Hexo has a log tags, which can help user to make special style contents.
Hexo standard tags
Block quote
1 | {% blockquote [author[, source]] [link] [source_link_title] %} |
Hi there is content here!
Code Block
1 | {% codeblock [title] [lang:language] [url] [link text] %} |
1 | alert('Hello World!'); |
Backtick Code Block
This is identical to using a code block, but instead uses three backticks to delimit the block.1
/[language] [title] [url] [link text] code snippet
Pull Quote
To add pull quotes to your posts:
1 | {% pullquote [class] %} |
content
jsFiddle
To embed a jsFiddle snippet:1
{% jsfiddle shorttag [tabs] [skin] [width] [height] %}
Gist
To embed a Gist snippet:1
{% gist gist_id [filename] %}
iframe
To embed an iframe:1
{% iframe url [width] [height] %}
Image
Inserts an image with specified size.
1 | {% img [class names] /path/to/image [width] [height] [title text [alt text]] %} |
Link
Inserts a link with target=”_blank” attribute.
1 | {% link text url [external] [title] %} |
Include Code
Inserts code snippets in source/downloads/code folder.1
{% include_code [title] [lang:language] path/to/file %}
YouTube
Inserts a YouTube video.
1 | {% youtube video_id %} |
Vimeo
Inserts a responsive or specified size Vimeo video.
1 | {% vimeo video_id [width] [height] %} |
Include Posts
Include links to other posts.
1 | {% post_path filename %} |
1 | {% post_link filename [optional text] %} |
You can ignore permalink and folder information, like languages and dates, when using this tag.
For instance:1
{% 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. Using post_path inside Markdown syntax is not supported.
For instance:
Display title of the post.
1 | {% post_link 2018-10-19-hexo-3-8-released %} |
Display custom text.
1 | {% post_link 2018-10-19-hexo-3-8-released 'Link to a post' %} |
Include Assets
Include post assets.1
2
3{% asset_path slug %}
{% asset_img slug [title] %}
{% asset_link slug [title] %}
Raw
If certain content is causing processing issues in your posts, wrap it with the raw tag to avoid rendering errors.
1 | {% raw %} |
Post Excerpt
Use text placed before the <!-- more -->
tag as an excerpt for the post.
example:1
2
3Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<!-- more -->
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
what is post excerpt
Here is some examples from hexo website, help how to user hexo tag plugins