Sha256: 0253beb02593b4ae119480bb94180b780504c129766d8ca6d3801e6a3c126c4a

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents

require 'middleman-core'
require 'middleman-blog'
require 'week_of_month'

module Middleman
	class CalendarExtension < Extension
		def initialize(app, options_hash={}, &block)
			super
			# place in class variable so helpers can access
			@@calendar_article = nil
		end

		helpers do
			def calendar(article, blog_name='blog')
				@calendar_article = article
				@blog_name = blog_name

				file = File.join(File.dirname(__FILE__), 'calendar.erb')
				ERB.new(File.read(file), 0, '>').result(binding)
			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
middleman-calendar-0.1.1 lib/middleman/calendar/extension.rb
middleman-calendar-0.1.0 lib/middleman/calendar/extension.rb