dimples 1.2.1 → 1.2.2

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
  SHA1:
3
- metadata.gz: 6744f1532ff98a72c8223b34b3a8854fcae1eaf3
4
- data.tar.gz: 599b462adcd549c6b9f6a1e8b6c8d9d7232c4345
3
+ metadata.gz: b06f5d85fc93430772a31fb3d59d95b386fe0584
4
+ data.tar.gz: 4a7d4a497a80f9562fc84785099daab430a20644
5
5
  SHA512:
6
- metadata.gz: 04342d92fbe4f2afc843eec7ed660d1c396ad546afe51e33811b645a540fd07a0661531a02eec2fcdaeebf75b19e0ae38a4401a01676d3ff675b0843444ef3f6
7
- data.tar.gz: 81c07fd8de2e2eda0b66fd953eb8bd0d1129872a3b9ecbf9c507d13a2e197ffa9da89fb4ff79146c32eae22d6771fe67614be90dce178ed292c0ef2db958b7ba
6
+ metadata.gz: 9f447f07a4c934b317eb7031c2bd9b83b6aaf3baae68d6198e9b5351fcec196204424a4c4bd054515ccaaddb9c2d2234ff5dfea367b7c6f71f1bd456a2f386d3
7
+ data.tar.gz: 8303a4f21392640686bd012cd1a5118cabf1a4df2957da8dc2010ac1f518da16da33e9fb70182365788933a79bdef443be5fff39d9ffd6956d5d381e09471eeb
data/lib/dimples/post.rb CHANGED
@@ -2,7 +2,7 @@ module Dimples
2
2
  class Post
3
3
  include Frontable
4
4
  include Publishable
5
-
5
+
6
6
  attr_accessor :path
7
7
  attr_accessor :title
8
8
  attr_accessor :template
@@ -16,6 +16,8 @@ module Dimples
16
16
  attr_accessor :month
17
17
  attr_accessor :day
18
18
  attr_accessor :rendered_contents
19
+ attr_accessor :previous_post
20
+ attr_accessor :next_post
19
21
 
20
22
  attr_writer :contents
21
23
 
data/lib/dimples/site.rb CHANGED
@@ -83,7 +83,6 @@ module Dimples
83
83
  end
84
84
 
85
85
  def scan_posts
86
-
87
86
  Dir.glob(File.join(@source_paths[:posts], '*.*')).reverse.each do |path|
88
87
  post = @post_class.new(self, path)
89
88
 
@@ -102,6 +101,11 @@ module Dimples
102
101
  @posts << post
103
102
  end
104
103
 
104
+ @posts.each_index do |index|
105
+ posts[index].next_post = @posts.fetch(index - 1, nil) if index - 1 > 0
106
+ @posts[index].previous_post = @posts.fetch(index + 1, nil) if index + 1 < @posts.count
107
+ end
108
+
105
109
  @latest_post = @posts.first
106
110
  end
107
111
 
@@ -190,7 +194,7 @@ module Dimples
190
194
 
191
195
  path += File.split(paths[0])[-1] + "/" if paths[0] != @output_paths[:site]
192
196
  path += paths[1..-1].join('/') + "/" if paths.length > 1
193
-
197
+
194
198
  path
195
199
  end
196
200
 
@@ -1,3 +1,3 @@
1
1
  module Dimples
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  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: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-22 00:00:00.000000000 Z
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt