Merge branch 'test'
[blog.git] / _plugins / debian.rb
1 module Jekyll
2 class RenderDebianPkgLinks < Liquid::Tag
3
4 def initialize(tag_name, text, tokens)
5 super
6 @text = text
7 @tag_name = tag_name
8 end
9
10 def render(context)
11 self.public_send(@tag_name) if self.respond_to? @tag_name
12 end
13
14 def deb_pkg()
15 "<a href=\"https://packages.debian.org/#{@text}\">#{@text}</a>"
16 end
17
18 def deb_bts()
19 "<a href=\"https://bugs.debian.org/#{@text}\">#{@text}</a>"
20 end
21 end
22 end
23
24 Liquid::Template.register_tag('deb_pkg', Jekyll::RenderDebianPkgLinks)
25 Liquid::Template.register_tag('deb_bts', Jekyll::RenderDebianPkgLinks)