Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rcmdnk/octopress-extlink

octopress-extlink provides "link" tag, used to add target="_blank" for external links.
https://github.com/rcmdnk/octopress-extlink

Last synced: about 1 month ago
JSON representation

octopress-extlink provides "link" tag, used to add target="_blank" for external links.

Awesome Lists containing this project

README

        

octopress-extlink
=================

octopress-extlink provides "link" tag for Octopress (Jekyll), used to add `target="_blank"` for external links.

# Installation

1. Copy `plugins/extlink.rb` to your `plugins` directory,

# Usage
Use tag `link` like

{%link URL LINK %}

If `URL` starts with `http` like

{%link http://example.com This is an external link. %}

the output becomes

This is an external link

Then, this link will be opend in new window.

If `URL` starts with `/` (i.e. your own site) like:

{%link /mysite This is my site. %}

the output becomes

This is my site.

so that it doesn't make new window.

You can add any attributes to `a` element by giving attributes before the URL (words starting with `http` or `/`), like

{%link class="myclass" http://example.com link %}

The outputs becomes

link

Multiple attributes can be given.

If you give "target" attribute, it is used instead of above definition.

{%link class="myclass" target="_self" http://example.com This is opend in the same window. %}

This tag will be:

This is opend in the same window.

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rcmdnk/octopress-extlink/trend.png)](https://bitdeli.com/free "Bitdeli Badge")