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



27
28
29
30
31
# File 'archive_display.rb', line 27

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)


35
36
37
38
39
40
# File 'archive_display.rb', line 35

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