Module: Dimples::Configuration
- Defined in:
- lib/dimples/configuration.rb
Overview
Default configuration options for a site.
Class Method Summary collapse
- .default_date_formats ⇒ Object
- .default_feed_formats ⇒ Object
- .default_generation ⇒ Object
- .default_layouts ⇒ Object
- .default_pagination ⇒ Object
- .default_paths ⇒ Object
- .defaults ⇒ Object
- .prepare(config) ⇒ Object
Class Method Details
.default_date_formats ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/dimples/configuration.rb', line 57 def self.default_date_formats { year: '%Y', month: '%Y-%m', day: '%Y-%m-%d' } end |
.default_feed_formats ⇒ Object
65 66 67 |
# File 'lib/dimples/configuration.rb', line 65 def self.default_feed_formats ['atom'] end |
.default_generation ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dimples/configuration.rb', line 35 def self.default_generation { paginated_posts: true, year_archives: true, month_archives: true, day_archives: true, categories: true, main_feed: true, category_feeds: true } end |
.default_layouts ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/dimples/configuration.rb', line 47 def self.default_layouts { post: 'post', category: 'category', paginated_post: 'paginated_post', archive: 'archive', date_archive: 'archive' } end |
.default_pagination ⇒ Object
69 70 71 72 73 74 |
# File 'lib/dimples/configuration.rb', line 69 def self.default_pagination { page_prefix: 'page_', per_page: 10 } end |
.default_paths ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/dimples/configuration.rb', line 25 def self.default_paths { archives: 'archives', paginated_posts: 'posts', posts: 'archives/%Y/%m/%d', drafts: 'archives/drafts/%Y/%m/%d', categories: 'archives/categories' } end |
.defaults ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dimples/configuration.rb', line 10 def self.defaults { source: Dir.pwd, destination: File.join(Dir.pwd, 'public'), paths: default_paths, generation: default_generation, layouts: default_layouts, pagination: default_pagination, date_formats: default_date_formats, feed_formats: default_feed_formats, category_names: {}, rendering: {} } end |
.prepare(config) ⇒ Object
6 7 8 |
# File 'lib/dimples/configuration.rb', line 6 def self.prepare(config) Hashie::Mash.new(defaults).deep_merge(config) end |