Class: Jekyll::FancyLinkTag

Inherits:
Liquid::Block
  • Object
show all
Defined in:
lib/jekyll_fancy_link.rb

Instance Method Summary collapse

Constructor Details

#initialize(_, date, _) ⇒ FancyLinkTag

Returns a new instance of FancyLinkTag.



5
6
7
8
# File 'lib/jekyll_fancy_link.rb', line 5

def initialize(_, date, _)
  @date = date.strip
  super
end

Instance Method Details

#parse(tokens) ⇒ Object



10
11
12
# File 'lib/jekyll_fancy_link.rb', line 10

def parse(tokens)
  super
end

#render(context) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/jekyll_fancy_link.rb', line 14

def render(context)
  @context = context

  @url, @anchor = super.split("\n").reject(&:empty?).map(&:strip)

  [ '<span class="fancylink">',
      "<a href=\"#{@url}\">#{@anchor}</a>",
      "<span>",
        external_link, archive_link,
      "</span>",
    "</span>"
  ].join(" ")
end