Class: Jekyll::LastModifiedAt::Tag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::LastModifiedAt::Tag
- Defined in:
- lib/jekyll-last-modified-at/tag.rb
Instance Method Summary collapse
-
#initialize(tag_name, format, tokens) ⇒ Tag
constructor
A new instance of Tag.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, format, tokens) ⇒ Tag
Returns a new instance of Tag.
6 7 8 9 |
# File 'lib/jekyll-last-modified-at/tag.rb', line 6 def initialize(tag_name, format, tokens) super @format = format.empty? ? nil : format.strip end |
Instance Method Details
#render(context) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/jekyll-last-modified-at/tag.rb', line 11 def render(context) site = context.registers[:site] format = @format || site.config.dig("last-modified-at", "date-format") article_file = context.environments.first["page"]["path"] Determinator.new(site.source, article_file, format) .formatted_last_modified_date end |