/web/_plugins/jal.rb
https://bitbucket.org/jlepak/csc-2012-spring · Ruby · 26 lines · 22 code · 4 blank · 0 comment · 0 complexity · 8e4c359aecd5bdea47ef81f884d0021a MD5 · raw file
- module Jekyll
- class RepoTag < Liquid::Tag
- def initialize(tag_name, text, tokens)
- super
- @text = text
- end
- def render(context)
- "https://bitbucket.org/jlepak/csc-2012-spring/src/default/#{@text}"
- end
- end
-
- class RepoTagRaw < Liquid::Tag
- def initialize(tag_name, text, tokens)
- super
- @text = text
- end
- def render(context)
- "https://bitbucket.org/jlepak/csc-2012-spring/raw/default/#{@text}"
- end
- end
- end
- Liquid::Template.register_tag('repo', Jekyll::RepoTag)
- Liquid::Template.register_tag('raw', Jekyll::RepoTagRaw)