dimples 10.1.0 → 10.1.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
  SHA256:
3
- metadata.gz: fcf53e67d092ae60028fef082c0741343badb88483bc2d1c6b19fea30d0a5aca
4
- data.tar.gz: bb884858e735d7e1c23c91a17c7f99ab8f4cddffa6b871530b85194147ac7fd4
3
+ metadata.gz: 3b53c9172b38c343af3d3dbb59e6afad5ae83b69dc67fd8ac3ac54235f1b84dc
4
+ data.tar.gz: 1fe366c13c8c0c78229c24c5fc8077a356688232b9c5753ca017c94ee0d04d63
5
5
  SHA512:
6
- metadata.gz: 8735afa42f1a1c921764bcc5a80babfa3620662c55beddd13f8825e19807bec00c5e1de835ff121221423b1c9dd04615456078461ba1be1ac28c85545b42af09
7
- data.tar.gz: a0ee67d073361ad66fbfa49f545b39b9753571d053b3d4cbab1fbbb54a0799a46cb53569c03dd6c3bbcc506b501ba758a40554fcc4a1fecf4a1118c709a225f5
6
+ metadata.gz: 035ac6bfdd3cb492b1959767405a7e0f17502226fa0df2795563b929a03a5c83221600ae33932aac7135553f9a730a5a44832652886a5b26a4ee50568556c748
7
+ data.tar.gz: 41c5bfabcce91caf99ef62ed3c92b5dbf8f338538c424d8d5e1ef087ac31e8f574f41cf0931862d75e2cf32d24f66300315ca3d6db1a4d633af82df61d91ee7c
@@ -31,11 +31,13 @@ module Dimples
31
31
  end
32
32
 
33
33
  def write(output_path = nil, metadata = {})
34
- output = render(metadata)
35
-
36
34
  output_path = File.join(output_directory, filename) if output_path.nil?
37
35
  output_dir = File.dirname(output_path)
38
36
 
37
+ @metadata[:url] = url_for(output_dir)
38
+
39
+ output = render(metadata)
40
+
39
41
  FileUtils.mkdir_p(output_dir) unless File.directory?(output_dir)
40
42
  File.write(output_path, output)
41
43
  end
@@ -54,8 +56,8 @@ module Dimples
54
56
  @site.config[:output][:root]
55
57
  end
56
58
 
57
- def url
58
- @metadata[:url] || output_directory.gsub(@site.config[:output][:root], '')
59
+ def url_for(path)
60
+ path.gsub(@site.config[:output][:root], '').concat('/')
59
61
  end
60
62
 
61
63
  def template
@@ -12,7 +12,7 @@ module Dimples
12
12
  end
13
13
 
14
14
  def url
15
- @metadata[:url] || super.tap do |url|
15
+ super.tap do |url|
16
16
  url.concat(filename) unless filename == 'index.html'
17
17
  end
18
18
  end
@@ -8,7 +8,11 @@ module Dimples
8
8
  @output_directory ||= File.dirname(@path).gsub(
9
9
  @site.config[:sources][:posts],
10
10
  @site.config[:output][:posts]
11
- ).concat("/#{@metadata[:slug]}/")
11
+ ).concat("/#{slug}/")
12
+ end
13
+
14
+ def slug
15
+ File.basename(@path)
12
16
  end
13
17
 
14
18
  def template
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '10.1.0'
4
+ VERSION = '10.1.2'
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.1.0
4
+ version: 10.1.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: 2024-02-04 00:00:00.000000000 Z
11
+ date: 2024-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: erubi
14
+ name: erb
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redcarpet
29
29
  requirement: !ruby/object:Gem::Requirement