dimples 10.6.0 → 10.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46c0d12cf89d7318ad1c0e9717a3389bc3b4033676206caddc8f31081975797a
4
- data.tar.gz: ed93b72589065aa25a013624ffec85a17a24629b15188bf3f0a83cbac4c52904
3
+ metadata.gz: 2dbafe84ea3b47edb09710e64408e2bd564463b3774812bf3738a4581778d14a
4
+ data.tar.gz: 8cd626b91b5487ff5ccd139e600e28154c3b9cf419d0c4f4fec03fbf26a9eec0
5
5
  SHA512:
6
- metadata.gz: 8518ff8cc7c925122dbe8ca28c0775497068a15ed2bc8426cf5006591e988e52c26c35d2c7a31b2229cd3f95825e654b126133122dbeab65b7b056918f99788d
7
- data.tar.gz: f1a58dc7294faec5b8e47547fccc07fea07225ba500cf509c55fcd84f0f4242757e27ebe2eb8d270de01218f53a14cc3d844ecb9181fccac631ba3d6089c93c4
6
+ metadata.gz: 2fa0abf7b05309cc28a094682391f884c9739dda4721ce45bf2a51988b36ecafafa454f236cccacc2731635970385a3e678136eadca78fd21c05f9cf6b23df44
7
+ data.tar.gz: '05093a25c038a0a2fe7b631de3c44135b313c83a82e3e59f8544b01caff9127bdb60ac8ff36f91f56185e9bfaaa640e25343d2811c0c0cef70b9ca3b9b091e53'
@@ -17,7 +17,7 @@ module Dimples
17
17
  source: Dir.pwd,
18
18
  build: './site',
19
19
  pathnames: { posts: 'posts', categories: 'categories' },
20
- site: { name: nil, domain: nil },
20
+ site: { name: nil, domain: nil, summary: nil },
21
21
  pagination: { page_prefix: 'page_', per_page: 5 },
22
22
  generation: { main_feed: true, category_feeds: false }
23
23
  }
data/lib/dimples/entry.rb CHANGED
@@ -61,7 +61,7 @@ module Dimples
61
61
 
62
62
  def render(context: {}, body: nil)
63
63
  context[:site] ||= @site.metadata
64
- context[:page] ||= @metadata
64
+ context[:page] ||= @metadata.merge(context)
65
65
 
66
66
  @rendered_contents = template.render(Metadata.new(context)) { body }
67
67
 
@@ -79,10 +79,6 @@ module Dimples
79
79
  @template ||= Tilt::ERBTemplate.new { @contents }
80
80
  end
81
81
 
82
- def to_h
83
- @metadata.to_h.merge({ contents: contents })
84
- end
85
-
86
82
  def method_missing(method_name, *_args)
87
83
  @metadata.send(method_name)
88
84
  end
@@ -15,6 +15,10 @@ module Dimples
15
15
  @data.keys
16
16
  end
17
17
 
18
+ def merge(hash)
19
+ @data.merge(hash)
20
+ end
21
+
18
22
  def [](key)
19
23
  @data[key]
20
24
  end
data/lib/dimples/pager.rb CHANGED
@@ -27,13 +27,11 @@ module Dimples
27
27
  (1..@page_count).each do |index|
28
28
  step_to(index)
29
29
 
30
- output_directory = File.join(@site.config.build_paths[:root], current_page_url)
31
-
32
- context.merge!(metadata, url: current_page_url)
30
+ output_directory = File.join(@site.config.build_paths[:root], current_page_path)
33
31
 
34
32
  @site.layouts[:posts]&.generate(
35
33
  output_path: File.join(output_directory, 'index.html'),
36
- context: context
34
+ context: metadata.merge(context, url: current_page_url)
37
35
  )
38
36
 
39
37
  yield(output_directory, context) if block_given?
@@ -60,6 +58,10 @@ module Dimples
60
58
  @current_page + 1 <= @page_count
61
59
  end
62
60
 
61
+ def current_page_path
62
+ @current_page == 1 ? @url : File.join(@url, "page_#{@current_page}")
63
+ end
64
+
63
65
  def current_page_url
64
66
  @current_page == 1 ? @url : "#{@url}#{@page_prefix}#{@current_page}"
65
67
  end
data/lib/dimples/post.rb CHANGED
@@ -22,13 +22,6 @@ module Dimples
22
22
  @template ||= Tilt::RedcarpetTemplate.new { @contents }
23
23
  end
24
24
 
25
- def to_h
26
- super.reject { |k, _| %i[filename layout].include?(k) }.tap do |output|
27
- output[:date] = output[:date].iso8601 unless output[:date].nil?
28
- output[:url] ||= url
29
- end
30
- end
31
-
32
25
  private
33
26
 
34
27
  def default_metadata
data/lib/dimples/site.rb CHANGED
@@ -58,7 +58,7 @@ module Dimples
58
58
  end
59
59
 
60
60
  def metadata
61
- @metadata ||= Metadata.new(posts: posts, categories: categories)
61
+ @metadata ||= Metadata.new(@config.site.merge(posts: posts, categories: categories.merge))
62
62
  end
63
63
 
64
64
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '10.6.0'
4
+ VERSION = '10.6.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.0
4
+ version: 10.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan