As Tag Plugins são diferentes das tags de postagem. Elas são portadas pela Octopress e fornecem uma maneira útil para você adicionar rapidamente conteúdo específico às suas postagens.
Bloco de Citação
Perfeito para adicionar citações à sua postagem, com informações opcionais de autor, fontes e título.
Alias: quote (citação)
{% blockquote [author[, source]] [link] [source_link_title] %} |
Exemplos
Sem argumentos. Bloco de citação simples.
{% 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.
Citação de um livro
{% blockquote David Levithan, Wide Awake %} |
Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy.
Citação de um twitter
{% blockquote @DevDocs https://twitter.com/devdocs/status/356095192085962752 %} |
NEW: DevDocs now comes with syntax highlighting. http://devdocs.io
Citação de um artigo da web
{% 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.
Bloco de Código
Funcionalidade útil para adicionar trechos de código à sua postagem.
Alias: code (Código-fonte)
{% codeblock [title] [lang:language] [url] [link text] [additional options] %} |
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 |
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 |
Exemplos
Um bloco de código simples
{% codeblock %} |
alert('Hello World!'); |
Em uma linguagem específica
{% codeblock lang:objc %} |
[rectangle setX: 10 y: 10 width: 20 height: 20]; |
Adicionando uma legenda ao código
{% codeblock Array.map %} |
array.map(callback[, thisArg]) |
Adicionando uma legenda e uma URL
{% codeblock _.compact http://underscorejs.org/#compact Underscore.js %} |
_.compact([0, 1, false, 2, '', 3]); |
Bloco de Código com Backtick
Isso é idêntico ao usar um bloco de código, mas usa três backticks (acentos grave) para delimitar o bloco.
``` [language] [title] [url] [link text] code snippet ```Pull Quote
Para adicionar pull quotes (citações destacadas) em sua postagem:
{% pullquote [class] %} |
jsFiddle
Para incorporar um snippet (trecho de código) do jsFiddle:
{% jsfiddle shorttag [tabs] [skin] [width] [height] %} |
Gist
Para incorporar um snippet (trecho de código) do Gist:
{% gist gist_id [filename] %} |
iframe
Para incorporar um iframe:
{% iframe url [width] [height] %} |
Imagem
Insere uma imagem com tamanho especificado.
{% img [class names] /path/to/image [width] [height] '"title text" "alt text"' %} |
Link
Insere um link com o atributo target="_blank"
.
{% link text url [external] [title] %} |
Incluir Código
Insere trechos de código no diretório source/downloads/code
.
{% include_code [title] [lang:language] path/to/file %} |
YouTube
Insere um vídeo do YouTube.
{% youtube video_id %} |
Vimeo
Insere um vídeo do Vimeo.
{% vimeo video_id %} |
Incluir Postagens
Incluir links para outras postagens.
{% post_path filename %} |
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. Using post_path
inside Markdown syntax []()
is not supported.
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 %}
Display custom text.
{% post_link hexo-3-8-released 'Link to a post' %}
Escape title.
{% post_link hexo-4-released 'How to use <b> tag in title' %} |
Do not escape title.
{% post_link hexo-4-released '<b>bold</b> custom title' false %} |
Incluir Assets
Incluir assets de postagem.
{% asset_path filename %} |
Raw
Se determinado conteúdo estiver causando problemas de processamento em suas postagens, envolva-o com a tag raw
para evitar erros de renderização.
{% raw %} |
Trecho de Postagem
Use o texto colocado antes da marcação <!-- more -->
como um trecho da publicação.
Exemplo:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |