Class: Jekyll::PlannerTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll-planningwikiplugins.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ PlannerTag

Returns a new instance of PlannerTag.



37
38
39
40
# File 'lib/jekyll-planningwikiplugins.rb', line 37

def initialize(tag_name, text, tokens)
    super
    @text = text
end

Instance Method Details

#render(context) ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/jekyll-planningwikiplugins.rb', line 42

def render(context)
    #Split by space
    tags = @text.split(' ')
    result = "tags: "
    tags.each do |tag|
        result = "#{result} <a href=\"/ref/planners/tags/#{tag.downcase}\">#{tag}</a>"
    end
    result
end