Class: Jekyll::Archive

Inherits:
Page
  • Object
show all
Defined in:
lib/jekyll/archive.rb

Instance Attribute Summary

Attributes inherited from Page

#content, #data, #ext, #output, #site

Instance Method Summary collapse

Methods inherited from Page

#process, #render, #write

Methods included from Convertible

#content_type, #do_layout, #read_yaml, #to_s, #transform

Constructor Details

#initialize(base, dir, type) ⇒ Archive

Initialize a new Archive.

+base+ is the String path to the <source>
+dir+ is the String path between <source> and the file

Returns <Archive>



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jekyll/archive.rb', line 9

def initialize(base, dir, type)
  @base = base
  @dir = dir
  @name = 'index.html'

  self.process(@name)

  self.read_yaml(File.join(base, '_layouts'), type + '.html')

  year, month, day = dir.split('/')
  self.data['year'] = year.to_i
  month and self.data['month'] = month.to_i
  day and self.data['day'] = day.to_i
end