Class: Jekyll::ArchiveLink::Tag
- Inherits:
-
Liquid::Block
- Object
- Liquid::Block
- Jekyll::ArchiveLink::Tag
- Defined in:
- lib/jekyll/archive_link/tag.rb
Instance Attribute Summary collapse
-
#link_text ⇒ Object
readonly
Returns the value of attribute link_text.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #archive_url ⇒ Object
-
#initialize(tag_name, link_text, tokens) ⇒ Tag
constructor
A new instance of Tag.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, link_text, tokens) ⇒ Tag
Returns a new instance of Tag.
10 11 12 13 |
# File 'lib/jekyll/archive_link/tag.rb', line 10 def initialize(tag_name, link_text, tokens) super @link_text = link_text end |
Instance Attribute Details
#link_text ⇒ Object (readonly)
Returns the value of attribute link_text.
8 9 10 |
# File 'lib/jekyll/archive_link/tag.rb', line 8 def link_text @link_text end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/jekyll/archive_link/tag.rb', line 8 def url @url end |
Instance Method Details
#archive_url ⇒ Object
22 23 24 25 26 |
# File 'lib/jekyll/archive_link/tag.rb', line 22 def archive_url Jekyll::ArchiveLink.debug("archive_url: #{@url}") URL.new(url).latest_archive_url end |
#render(context) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/jekyll/archive_link/tag.rb', line 15 def render(context) @url = super(context).to_s.strip Jekyll::ArchiveLink.debug("Render called: #{@url}") %[<a href="#{archive_url}">#{link_text}</a>] end |