dimples 1.6.3 → 1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimples/configuration.rb +3 -0
- data/lib/dimples/site.rb +22 -18
- data/lib/dimples/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2195d33c5db58576e330e294263c8e0372b5751b
|
4
|
+
data.tar.gz: 8395118f614c8e2e72a31f43cb57717ca8d79c8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4b5a24e2576217a18ab9cb26c060fdf9775e6b73f6302a008df047b9d4b6ed1960b6221cada8cbcdd5f76d5e6a8e0e1aece6b410981614e2c3c63680d20d938
|
7
|
+
data.tar.gz: dc5359f9081e0628ee56902834bd38f9717112c72d41622a9f0d7b9961795624beb728a9ea80595f3c61d4d91866e0b1781b21f88b025d0249744039e55a4fb9
|
data/lib/dimples/site.rb
CHANGED
@@ -33,13 +33,13 @@ module Dimples
|
|
33
33
|
@source_paths[:root] = File.expand_path(@config['source_path'])
|
34
34
|
@output_paths[:site] = File.expand_path(@config['destination_path'])
|
35
35
|
|
36
|
-
%w
|
36
|
+
%w[pages posts public templates].each do |path|
|
37
37
|
@source_paths[path.to_sym] = File.join(@source_paths[:root], path)
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
%w[archives posts categories].each do |path|
|
41
|
+
@output_paths[path.to_sym] = File.join(@output_paths[:site], @config['paths'][path])
|
42
|
+
end
|
43
43
|
end
|
44
44
|
|
45
45
|
def generate(options = {})
|
@@ -100,13 +100,9 @@ module Dimples
|
|
100
100
|
(@categories[slug] ||= []) << post
|
101
101
|
end
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
date_key = post.date.strftime(@config['date_formats'][date_type])
|
107
|
-
(@archives[date_type.to_sym][date_key] ||= []) << post
|
108
|
-
end
|
109
|
-
end
|
103
|
+
(@archives[:year][post.year] ||= []) << post
|
104
|
+
(@archives[:month]["#{post.year}/#{post.month}"] ||= []) << post
|
105
|
+
(@archives[:day]["#{post.year}/#{post.month}/#{post.day}"] ||= []) << post
|
110
106
|
|
111
107
|
@posts << post
|
112
108
|
end
|
@@ -165,15 +161,23 @@ module Dimples
|
|
165
161
|
%w[year month day].each do |date_type|
|
166
162
|
|
167
163
|
if @config['generation']["#{date_type}_archives"]
|
164
|
+
template = @config['layouts']["#{date_type}_archives"]
|
168
165
|
|
169
|
-
|
170
|
-
|
171
|
-
|
166
|
+
@archives[date_type.to_sym].each_value do |posts|
|
167
|
+
title = posts[0].date.strftime(@config['date_formats'][date_type])
|
172
168
|
paths = [@output_paths[:archives], posts[0].year]
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
169
|
+
dates = {year: posts[0].year}
|
170
|
+
|
171
|
+
case date_type
|
172
|
+
when 'month'
|
173
|
+
paths << posts[0].month
|
174
|
+
dates[:month] = posts[0].month
|
175
|
+
when 'day'
|
176
|
+
paths.concat([posts[0].month, posts[0].day])
|
177
|
+
dates[:day] = posts[0].month
|
178
|
+
end
|
179
|
+
|
180
|
+
paginate(posts: posts, title: title, paths: paths, layout: template, context: dates)
|
177
181
|
end
|
178
182
|
end
|
179
183
|
end
|
data/lib/dimples/version.rb
CHANGED
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: 1.
|
4
|
+
version: '1.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.5.1
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: A basic static site generator
|