The following content is taken from Hexo documentation with minor revisions.
























The following content is taken from Hexo documentation with minor revisions.
Tag plugins are different from post tags. They are ported from Octopress and provide a useful way for you to quickly add specific content to your posts.
Perfect for adding quotes to your post, with optional author, source and title information.
Alias: quote
1 | {% blockquote [author[, source]] [link] [source_link_title] %} |
No arguments. Plain blockquote.
1 | {% 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.
Quote from a book
1 | {% blockquote David Levithan, Wide Awake %} |
Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy.
Quote from Twitter
1 | {% blockquote @DevDocs https://twitter.com/devdocs/status/356095192085962752 %} |
NEW: DevDocs now comes with syntax highlighting. http://devdocs.io
Quote from an article on the web
1 | {% 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.
Useful feature for adding code snippets to your post.
Alias: code
1 | {% codeblock [title] [lang:language] [url] [link text] %} |
A plain code block
1 | {% codeblock %} |
1 | alert('Hello World!'); |
Specifying the language
1 | {% codeblock lang:objc %} |
1 | [rectangle setX: 10 y: 10 width: 20 height: 20]; |
Adding a caption to the code block
1 | {% codeblock Array.map %} |
1 | array.map(callback[, thisArg]) |
Adding a caption and a URL
1 | {% codeblock _.compact http://underscorejs.org/#compact Underscore.js %} |
1 | _.compact([0, 1, false, 2, '', 3]); |
This is identical to using a code block, but instead uses three backticks to delimit the block.
1 | ``` [language] [title] [url] [link text] |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi semper auctor nulla, a mollis nibh congue luctus. Mauris sagittis dui sit amet scelerisque gravida. Proin porttitor convallis libero.
To add pull quotes to your posts:
1 | {% pullquote [CSS class] %} |
To embed a jsFiddle snippet:
1 | {% jsfiddle shorttag [tabs] [skin] [width] [height] %} |
To embed a Gist snippet:
1 | {% gist gist_id [filename] %} |
To embed an iframe:
1 | {% iframe url [width] [height] %} |
Inserts an image with specified size.
1 | {% img [class names] /path/to/image [width] [height] [title text [alt text]] %} |
Inserts a link with target="_blank" attribute.
1 | {% link text url [external] [title] %} |
Inserts code snippets in source/downloads/code folder.
1 | {% include_code [title] [lang:language] path/to/file %} |
Inserts a YouTube video.
1 | {% youtube video_id %} |
Inserts a Vimeo video.
1 | {% vimeo video_id %} |
Include links to other posts.
1 | {% post_path slug %} |
Include post assets.
1 | {% asset_path slug %} |
If certain content is causing processing issues in your posts, wrap it with the raw tag to avoid rendering errors.
1 | {% raw %} |
Use text placed before the <!-- more --> tag as an excerpt for the post.
Examples:
1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。