Sha256: 773ef9b6dee2ef2f32d0b3f961f3120c7c8e00d06653472c530e34bdecc7d023

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

# coding: utf-8

module Retter
  class Pages::Entry
    include Page

    attr_reader :entry

    def initialize(entry)
      super()

      @path_prefix = '../'
      @entry       = entry
      @title       = "#{entry.date} - #{config.title}"
    end

    def pathname
      Pages.entry_file(entry.date)
    end

    def part_layout_pathname
      Pages.find_layout_path('entry')
    end

    def print
      part = Tilt.new(
        part_layout_pathname.to_path,
        ugly: true,
        filename: part_layout_pathname.to_path
      ).render(view_scope, entry: entry)

      print_with_layout part
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
retter-0.2.2 lib/retter/pages/entry.rb
retter-0.2.1 lib/retter/pages/entry.rb