Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

Filter to encode URI component like JavaScript's encodeURIComponent() for Jekyll/Octopress.
https://github.com/rcmdnk/octopress-encodeuricomponent

Last synced: about 1 month ago
JSON representation

Filter to encode URI component like JavaScript's encodeURIComponent() for Jekyll/Octopress.

Awesome Lists containing this project

README

        

octopress-encodeURIComponent
============================

Filter to encode URI component like JavaScript's encodeURIComponent() for Jekyll/Octopress.

# Installation

Copy `plugins/keyboardkey.rb` to your `plugins` directory. That's all!

# Usage

Use as a filter for Liquid values like

This is original: {{site.url}}

This is encoded: {{site.url|encodeURIComponent}}

If the `site.url` is `http://rcmdnk.github.io/`, this will be

This is original: http://rcmdnk.github.io/

This is encoded: http%3A%2F%2Frcmdnk.github.io%2F

This is useful especially if you want to pass uri to such tumblr's share link:

Tumblr

Original buttons ([Buttons | Tumblr](http://www.tumblr.com/buttons)) are provided with additional JavaScript to encode these items.
But you don't need such script with this filter and can write directly in one place.

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