October anchor addition
I use Octopress, and I know that to add an image to my post instead of writing:
<img src="src" alt="alt" class="class" /> I can write:
{% img class src alt %} And if you write:
<a href="href">text</a> I can write:
[text](href) But how can I write:
<a href="href" target="target">text</a> ?
If this is not possible and the only solution is to write the html tag, where and how can I add the ruby code, translate this, for example: [text](href target) : <a href="href" target="target">text</a> ?
Also, where can I find a list of all these html octopress shortcuts?
In fact, this is controlled by the Markdown engine used to process text, not any Octopress code. Depending on the engine you are using, you can write
[text](href){: target="target" } This is called an "inline attribute list" and is an extension of the Markdown syntax. It is supported by Maruku as well as Kramdown .
(Note that Maruku is Jekyll's default Markdown mechanism, so this syntax is supported if you haven't touched on this aspect of the configuration.)
{% img class src alt %} is an octapress tag, see plugins for more tags.
[text](href) follows markdown sintax and does not allow classes, attributes or identifiers to be added to elements.
So, to fix the target problem, use snipet below in your custom header layout and add the #_blank anchor at the end of the url to open it in a new window.
<script type="text/javascript"> function addBlankTargetForLinks () { $('a[href^="http"],a[href*="#_blank"]').each(function(){ $(this).attr('target', '_blank'); }); } $(document).bind('DOMNodeInserted', function(event) { addBlankTargetForLinks(); }); </script>