Created
April 1, 2015 09:45
-
-
Save thedod/c7b2fd9c2844a604cf07 to your computer and use it in GitHub Desktop.
Dumbest possible Jekyll plugin: prefix site.baseurl
This file contains hidden or 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
# {% site_url /some/path/to/file.suffix %} is like {{ '/some/path/to/file.suffix' |:prefix site.baseurl }} | |
module Jekyll | |
class SiteUrl < Liquid::Tag | |
def initialize(name, url, tokens) | |
super | |
@url = url | |
end | |
def render(context) | |
context.registers[:site].baseurl+@url | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment