Class: Jekyll::RenderLastVersion
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::RenderLastVersion
- Defined in:
- lib/jekyll/version/tags/render-last-version.rb
Instance Method Summary collapse
-
#initialize(tag_name, text, tokens) ⇒ RenderLastVersion
constructor
A new instance of RenderLastVersion.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, text, tokens) ⇒ RenderLastVersion
Returns a new instance of RenderLastVersion.
4 5 6 7 8 |
# File 'lib/jekyll/version/tags/render-last-version.rb', line 4 def initialize(tag_name, text, tokens) super path = "#{Dir.pwd}/_docs/*" @lastVersion = Dir[path].last().to_s.split("/").last() end |
Instance Method Details
#render(context) ⇒ Object
10 11 12 |
# File 'lib/jekyll/version/tags/render-last-version.rb', line 10 def render(context) "#{@lastVersion}" end |