Class: ArchiveDisplayTag::ArchiveDisplay

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
archive_display.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, archive_name, tokens) ⇒ void

Constructor.

Parameters:

  • tag_name (String)

    is the name of the tag, which we already know.

  • archive_name (Hash, String, Liquid::Tag::Parser)

    the arguments from the web page.

  • tokens (Liquid::ParseContext)

    tokenized command line



25
26
27
28
29
# File 'archive_display.rb', line 25

def initialize(tag_name, archive_name, tokens)
  super
  archive_name.strip!
  @archive_name = archive_name
end

Instance Method Details

#render(context) ⇒ String

Method prescribed by the Jekyll plugin lifecycle.

Returns:

  • (String)


33
34
35
36
37
38
# File 'archive_display.rb', line 33

def render(context)
  source = context.registers[:site].config['source']
  tar_name = "#{source}/#{@archive_name}"
  ArchiveDisplayTag.log.info "archive_display: tar_name=#{tar_name}"
  traverse_tar(tar_name)
end