initialize

in _plugins/monthly_archive_plugin.rb [57:87]


    def initialize(site, dir, year, month, posts)
      @site = site
      @dir = dir
      @year = year
      @month = month
      @archive_dir_name = '%04d/%02d' % [year, month]
      @date = Date.new(@year, @month)
      @layout =  site.config['monthly_archive'] && site.config['monthly_archive']['layout'] || 'monthly_archive'
      self.ext = '.html'
      self.basename = 'index'
      self.content = <<-EOS
{% for post in page.posts %}
<div class="news">
    <h3>{{post.title}}</h3>
  <p><small>{{post.date | date_to_string}}</small></p>
    {{ post.content | truncatehtml: 200 }}
    <a href="{{ site.baseurl }}{{post.url}}">more</a></li>
</div>
{% endfor %}
      EOS
      self.data = {
          'layout' => @layout,
          'type' => 'archive',
          'title' => "Monthly archive for #{@date.strftime('%B %Y')}",
          'posts' => posts,
          'url' => File.join('/',
                     MonthlyArchiveUtil.archive_base(site),
                     @archive_dir_name, 'index.html')
      }
    end