dimples 7.0 → 7.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 882aeff0d91ba61d58f331bedabeba0c865dbb7ef355c1fdafde7e1605113d2e
4
- data.tar.gz: 8ddfc8ea5bcbce38a35c8d0153f96adc4866f5529a074884e966b92a65dce642
3
+ metadata.gz: 4d875122c066481143980525752a32a86d661a4b9d5042db8ab124f316d46f0b
4
+ data.tar.gz: ffa868119e0af8edfd87d5fa8a2e87d03f35e9e01e30c2751278848afa9b50e5
5
5
  SHA512:
6
- metadata.gz: cc9caa2de2a10ac6a30f84876ad3a3e9bd070b2e3e9783f38763035d286ec46d55343fa6fbf5cb44c6b72fe3c67d773af7918cbcb714cdb10f2c4b4a6b52b1e4
7
- data.tar.gz: 04510c31f0ee4de0d1e035ddf56003f12e4553bdaaf1b4a8f82d24c0344bae443443b8d4f73c58e6ae7c3a5447e73f734f315964c30dcb400f85b28fa9066042
6
+ metadata.gz: 29d0a8ccfd39cf3ba89b0d9a47ea099e902dca582c23aa1fe47c54a94888f421c2d8722375a3c0a626ac5fd38830a086bab8a2321d37171e5ec7c4e6d863c05d
7
+ data.tar.gz: b4c18c20446327db58bdb7eacf4b01855d389dbf4c2b274cc3ddd96fbb3e11cc6d06e576c847b9f7fc92c7e8311efbf2cb4f08366f64bdc3e48ffad4835cb482
data/lib/dimples/site.rb CHANGED
@@ -19,6 +19,8 @@ module Dimples
19
19
  destination: File.expand_path(output_path)
20
20
  }
21
21
 
22
+ @config = read_config
23
+
22
24
  %w[pages posts static templates].each do |type|
23
25
  @paths[type.to_sym] = File.join(@paths[:source], type)
24
26
  end
@@ -45,6 +47,13 @@ module Dimples
45
47
 
46
48
  private
47
49
 
50
+ def read_config
51
+ config_path = File.join(@paths[:source], '.config')
52
+
53
+ return {} unless File.exist?(config_path)
54
+ YAML.load(File.read(config_path), symbolize_names: true)
55
+ end
56
+
48
57
  def read_files(path)
49
58
  Dir[File.join(path, '**', '*.*')].sort
50
59
  end
@@ -107,7 +116,7 @@ module Dimples
107
116
  end
108
117
 
109
118
  def generate_posts
110
- directory_path = File.join(@paths[:destination], 'posts')
119
+ directory_path = File.join(@paths[:destination], @config.dig(:paths, :posts) || 'posts')
111
120
  Dir.mkdir(directory_path)
112
121
 
113
122
  @posts.each do |post|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '7.0'
4
+ VERSION = '7.0.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: '7.0'
4
+ version: 7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan