dimples 4.0.3 → 4.0.4

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: 7cc6631e27a7daedd1b696ebd6d45611142a803a
4
- data.tar.gz: b16ce92da9a1f5569ec48542033fa2dd81d8fca2
3
+ metadata.gz: 0755cd5a0b034bff5a1c769df13879e69a379000
4
+ data.tar.gz: 5f0d161f272a6797891d921e50bfc06eb6a7d595
5
5
  SHA512:
6
- metadata.gz: 254538579b2037ffa5750a88bee35819438baf4471dbf6b41fe53d5babc651a292b6c4d87515502912b9ea60c5f49a1349c35fff8b6d1847273c5c3573163f1c
7
- data.tar.gz: 3b66e100b647f29c4cd2cef16952e34602a2a6fc0bb9220d6d67d4dccc21daa032af3838c7d2828624f151ac3994a8ed72dcea1bcbdb9b11179dc2b1433d591e
6
+ metadata.gz: 4ef8335352b2a0fa0b3c2c7ac8e3e25235f6f3be4e466a7f6ae8a00a67253969eed15717a9f34b2ca4599a9a6b9e06302fba228e64383f02ba167baacc95a95a
7
+ data.tar.gz: c7fadf424dd0d86e873f3c133fece02abbca101d76f0be50a5ace06c396b1ab20837481677d96f6a6507d2859e8acceb052ed78b26032d4b81ddeb07fc40f10a
data/lib/dimples/page.rb CHANGED
@@ -35,7 +35,21 @@ module Dimples
35
35
  end
36
36
 
37
37
  def output_path
38
- File.join(@output_directory, "#{@filename}.#{@extension}")
38
+ File.join(@output_directory, output_filename)
39
+ end
40
+
41
+ def output_filename
42
+ "#{@filename}.#{@extension}"
43
+ end
44
+
45
+ def url
46
+ absolute_output_directory = File.absolute_path(@output_directory)
47
+
48
+ absolute_output_directory.sub(@site.output_paths[:site], '').tap do |url|
49
+ url[0] = '/' unless url[0] == '/'
50
+ url.concat('/') unless url[-1] == '/'
51
+ url.concat(output_filename) if filename != 'index'
52
+ end
39
53
  end
40
54
 
41
55
  def write(context = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '4.0.3'
4
+ VERSION = '4.0.4'
5
5
  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: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-26 00:00:00.000000000 Z
11
+ date: 2017-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt