Class: Jekyll::ArchiveDisplayTag

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

Overview

Executes a program and returns the output from STDOUT.

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, archive_name, tokens) ⇒ void

Parameters:

  • tag_name (String)

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

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

    the arguments from the web page.

  • tokens (Liquid::ParseContext)

    tokenized command line



20
21
22
23
24
# File 'lib/archive_display.rb', line 20

def initialize(tag_name, archive_name, tokens)
  super(tag_name, archive_name, tokens)
  @logger = PluginMetaLogger.instance.new_logger(self, PluginMetaLogger.instance.config)
  @archive_name = archive_name.strip
end

Instance Method Details

#render(context) ⇒ String

Method prescribed by the Jekyll plugin lifecycle.

Returns:

  • (String)


28
29
30
31
32
33
# File 'lib/archive_display.rb', line 28

def render(context)
  source = context.registers[:site].config["source"]
  tar_name = "#{source}/#{@archive_name}"
  @logger.debug "tar_name=#{tar_name}"
  traverse_tar(tar_name)
end