dimples 11.1.0 → 11.2.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 +4 -4
- data/lib/dimples/post.rb +2 -0
- data/lib/dimples/site.rb +10 -7
- 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: 53b0d98c918f5d4860900213f9797177cc07a801464911856127d8f3bb4e6ac0
|
|
4
|
+
data.tar.gz: c48d064da98832cfda7d8a878929dcfa1914e584521bc9cd2eab62f2c9245012
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 99fe1fdcdd089fa248708aace30b3593ca4935e344206bc37118e20c8421992fe0acf8c10c0b32a713c1b71533b2612f59fd1b089491fa2a5fe4dfb57a4b7abf
|
|
7
|
+
data.tar.gz: 1d0a41b232f0f6caacaba68ed9ec39013e40a75812564c6391f7b2120f6cc2556b329cc774cdf6816ac9ac0b1df89059ae8229ca592a5bbd21211fd4991b54d9
|
data/lib/dimples/post.rb
CHANGED
data/lib/dimples/site.rb
CHANGED
|
@@ -145,16 +145,19 @@ module Dimples
|
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
context = { page: Context.from_hash(entry.metadata.merge(context)), site: self }
|
|
148
|
-
body = entry.contents
|
|
149
148
|
full_path = File.join(output_path, entry.filename)
|
|
150
149
|
|
|
151
|
-
until entry.nil?
|
|
152
|
-
body = entry.render(context: context) { body }
|
|
153
|
-
entry = templates[entry.layout&.to_sym]
|
|
154
|
-
end
|
|
155
|
-
|
|
156
150
|
FileUtils.mkdir_p(output_path) unless File.directory?(output_path)
|
|
157
|
-
File.write(full_path, body)
|
|
151
|
+
File.write(full_path, render_entry(entry: entry, context: context, body: entry.contents))
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def render_entry(entry:, context: {}, body: nil)
|
|
155
|
+
rendered_body = entry.render(context: context) { body }.strip
|
|
156
|
+
|
|
157
|
+
template = templates[entry.layout&.to_sym]
|
|
158
|
+
return rendered_body if template.nil?
|
|
159
|
+
|
|
160
|
+
render_entry(entry: template, context:, body: rendered_body)
|
|
158
161
|
end
|
|
159
162
|
|
|
160
163
|
def prepare_output_directory
|
data/lib/dimples/version.rb
CHANGED