dimples 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b28b18c7a1d70bec5bb597f86ce463cf1ba1d145
4
- data.tar.gz: adabb1486a6d04c4ad7ac6cb8b655898cf0c987e
3
+ metadata.gz: 2421b96587bc304996570ff3802c720e92d534e9
4
+ data.tar.gz: 74b291833e3e6425e0b8137561f59ac54982b578
5
5
  SHA512:
6
- metadata.gz: 7f2c51438a1f720fbff005ee906644e6debfdd2c87136012bab712acb948371a4eefae56d05ed1dce372f89e9129c32daf63ff89d6c746f06d1d613915e75316
7
- data.tar.gz: 45e37e1cc7f02fb717c097ab142b6689c2643520c18620986d4a1051cc5091bc972dcf19eb02bbf27659193547888812bf2a676598f9a0022d9ff2429f4ebdb2
6
+ metadata.gz: c1a0a782d1bd484b9e83a2e6ced7ee82874875f5fc8b574094ef43d864c7349c4f8b672d01cc5efbb6ddb87fd00b0b4f0edb49d6f725abb2e5991f48d4450871
7
+ data.tar.gz: df14101587a2ede3d70b34eb8e4807d6d9e985c3998a40dbae05fbb832ab65b77ddf4ce70cd227c6456e41539777261448528fd7ca3c691e68c298c75e8ca515
@@ -36,7 +36,6 @@ module Dimples
36
36
  'layouts' => default_layouts,
37
37
  'pagination' => default_pagination,
38
38
  'generation' => default_generation,
39
- 'feed_formats' => default_feed_formats,
40
39
  'date_formats' => default_date_formats
41
40
  }
42
41
  end
@@ -77,10 +76,6 @@ module Dimples
77
76
  }
78
77
  end
79
78
 
80
- def self.default_feed_formats
81
- ['atom']
82
- end
83
-
84
79
  def self.default_date_formats
85
80
  {
86
81
  'year' => '%Y',
data/lib/dimples/site.rb CHANGED
@@ -93,7 +93,16 @@ module Dimples
93
93
  def scan_templates
94
94
  Dir.glob(File.join(@source_paths[:templates], '**', '*.*')).each do |path|
95
95
  template = Dimples::Template.new(self, path)
96
- @templates[template.slug] = template
96
+
97
+ parent_path = File.dirname(path)
98
+ if parent_path == @source_paths[:templates]
99
+ slug = template.slug
100
+ else
101
+ relative_path = parent_path.gsub(@source_paths[:templates], '')[1..-1]
102
+ slug = relative_path.gsub(File::SEPARATOR, '.') + ".#{template.slug}"
103
+ end
104
+
105
+ @templates[slug] = template
97
106
  end
98
107
  end
99
108
 
@@ -256,13 +265,13 @@ module Dimples
256
265
  end
257
266
 
258
267
  def generate_feeds(path, options)
259
- @config['feed_formats'].each do |format|
268
+ feed_templates.each do |format|
260
269
  next unless @templates[format]
261
270
 
262
271
  feed = @page_class.new(self)
263
272
 
264
273
  feed.filename = 'feed'
265
- feed.extension = format
274
+ feed.extension = @templates[format].slug
266
275
  feed.layout = format
267
276
 
268
277
  feed.write(feed.output_path(path), options)
@@ -283,6 +292,10 @@ module Dimples
283
292
  end
284
293
  end
285
294
 
295
+ def feed_templates
296
+ @feed_templates ||= @templates.keys.select { |k| k =~ /^feeds\./ }
297
+ end
298
+
286
299
  def copy_assets
287
300
  if Dir.exist?(@source_paths[:public])
288
301
  Dimples.logger.debug('Copying assets...') if @config['verbose_logging']
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '2.5.1'.freeze
4
+ VERSION = '2.6.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-28 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.4.5
173
+ rubygems_version: 2.6.11
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: A basic static site generator