Module: Middleman::BlogPage
- Defined in:
- lib/middleman-blog_page/version.rb,
lib/middleman-blog_page/extension_3_0.rb,
lib/middleman-blog_page/blog_page_data.rb,
lib/middleman-blog_page/blog_page_article.rb
Defined Under Namespace
Modules: BlogPageArticle, Helpers Classes: BlogPageData, Options
Constant Summary collapse
- VERSION =
"0.0.3"
Class Method Summary collapse
- .registered(app, options_hash = {}) {|options| ... } ⇒ Object (also: included)
Class Method Details
.registered(app, options_hash = {}) {|options| ... } ⇒ Object Also known as: included
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/middleman-blog_page/extension_3_0.rb', line 24 def registered(app, ={}, &block) require 'middleman-blog/blog_page_data' require 'middleman-blog/blog_page_article' require 'active_support/core_ext/time/zones' app.send :include, Helpers = Options.new() yield if block_given? .permalink ||= ":title.html" .sources ||= "pages/:title.html" .layout ||= "layout" .default_extension ||= ".markdown" # If "prefix" option is specified, all other paths are relative to it. if .prefix .prefix = "/#{.prefix}" unless .prefix.start_with? '/' .permalink = File.join(.prefix, .permalink) .sources = File.join(.prefix, .sources) end app.after_configuration do # Make sure ActiveSupport's TimeZone stuff has something to work with, # allowing people to set their desired time zone via Time.zone or # set :time_zone Time.zone = self.time_zone if self.respond_to?(:time_zone) time_zone = Time.zone if Time.zone zone_default = Time.find_zone!(time_zone || 'UTC') unless zone_default raise 'Value assigned to time_zone not recognized.' end Time.zone_default = zone_default # Initialize blog with options blog_page() sitemap.register_resource_list_manipulator( :blog_pages, blog_page, false ) end end |