Class: Jekyll::PlannerTag

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

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ PlannerTag

Returns a new instance of PlannerTag.



6
7
8
9
# File 'lib/jekyll-plannertags.rb', line 6

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

Instance Method Details

#render(context) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/jekyll-plannertags.rb', line 11

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