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 +4 -4
- data/lib/dimples/site.rb +10 -1
- data/lib/dimples/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d875122c066481143980525752a32a86d661a4b9d5042db8ab124f316d46f0b
|
4
|
+
data.tar.gz: ffa868119e0af8edfd87d5fa8a2e87d03f35e9e01e30c2751278848afa9b50e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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|
|
data/lib/dimples/version.rb
CHANGED