Url decode in jekyll
Create file at _plugins/url_decode.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# _plugins/url_decode.rb | |
require 'liquid' | |
require 'uri' | |
module URLDecode | |
def url_decode(url) | |
return URI.decode(url) | |
end | |
end | |
Liquid::Template.register_filter(URLDecode) |
Usage
{{ page.url | url_decode }}
Escaping double curly braces inside a markdown code block in Jekyll
{{ page.url }}.
Original link:https://izhangzhihao.github.io//2018/02/03/Url-decode-in-jekyll/