jekyll 4.3.0 → 4.3.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: 96201c2ad5de2a82883b9efe695bfd44841b88be07a878479b6cda7bac0c2c9e
4
- data.tar.gz: b23a9dcb412a6605a65aea79fbec04cff5f6e2d219c0009cf22a624a7514a19f
3
+ metadata.gz: 347e7eea42afb6073288ca30a52df201c93ba8cb11883e07f7d02790516f4a0c
4
+ data.tar.gz: e319f9f8183ac7712a5c215f0fbf083c7a84c06f8c716b3170ae17f6e96c8fb8
5
5
  SHA512:
6
- metadata.gz: 457379d010c3e05bd5ee7472a38574ac5101af8740949738b221d8db369dcbae83d659591096876eff2878962a824d1f4abebd17f81be869889d4be2cb6e2d53
7
- data.tar.gz: e2feb1925ca0ac86528b53c8e72f1f121b39deaaae92f21d777d10b8c2224e75ea6070553e276962b248d1a8d2a89812472d60d9502b110abf6268702ac2c3d7
6
+ metadata.gz: 6b146b2b681d7e3735faaa93f87ea00ba7500a1789820238d5883ff17f353207c987d70a2fbbd4bbe1f56ff784c7f9d3198b4232b48f2f5920a6664e45511cd0
7
+ data.tar.gz: 55ad809278c2624d4b13316ec7436022e71fcf543cf84c1bd4d04fc3660efc948951ed3f13b487bddb8041be80e885aa6fd24ad1165795b08752f5210c35b152
File without changes
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  ---
3
3
 
4
- @import "main";
4
+ @import "base";
@@ -12,7 +12,6 @@ module Jekyll
12
12
  mutable false
13
13
 
14
14
  delegate_method_as :relative_path, :path
15
- delegate_method_as :basename, :name
16
15
  private delegate_method_as :data, :fallback_data
17
16
 
18
17
  delegate_methods :id, :output, :content, :to_s, :relative_path, :url, :date
@@ -26,6 +25,10 @@ module Jekyll
26
25
  fallback_data["excerpt"].to_s
27
26
  end
28
27
 
28
+ def name
29
+ fallback_data["name"] || @obj.basename
30
+ end
31
+
29
32
  def <=>(other)
30
33
  return nil unless other.is_a? DocumentDrop
31
34
 
@@ -16,7 +16,7 @@ module Jekyll
16
16
  end
17
17
 
18
18
  def name
19
- @obj.doc.basename
19
+ @obj.doc.data["name"] || @obj.doc.basename
20
20
  end
21
21
  end
22
22
  end
@@ -7,6 +7,7 @@ module Jekyll
7
7
 
8
8
  mutable false
9
9
 
10
+ delegate_method_as :site_data, :data
10
11
  delegate_methods :time, :pages, :static_files, :tags, :categories
11
12
 
12
13
  private delegate_method_as :config, :fallback_data
@@ -23,12 +24,6 @@ module Jekyll
23
24
  (key != "posts" && @obj.collections.key?(key)) || super
24
25
  end
25
26
 
26
- def data
27
- @obj.site_data.tap do |value|
28
- value.context = @context if value.respond_to?(:context=)
29
- end
30
- end
31
-
32
27
  def posts
33
28
  @site_posts ||= @obj.posts.docs.sort { |a, b| b <=> a }
34
29
  end
@@ -15,16 +15,12 @@ module Jekyll
15
15
 
16
16
  private
17
17
 
18
- # rubocop:disable Metrics/AbcSize
19
18
  def data_for_table(num_of_rows)
20
19
  sorted = @stats.sort_by { |_, file_stats| -file_stats[:time] }
21
20
  sorted = sorted.slice(0, num_of_rows)
22
21
 
23
22
  table = [header_labels]
24
- totals = Hash.new { |hash, key| hash[key] = 0 }
25
-
26
23
  sorted.each do |filename, file_stats|
27
- GAUGES.each { |gauge| totals[gauge] += file_stats[gauge] }
28
24
  row = []
29
25
  row << filename
30
26
  row << file_stats[:count].to_s
@@ -33,14 +29,8 @@ module Jekyll
33
29
  table << row
34
30
  end
35
31
 
36
- footer = []
37
- footer << "TOTAL (for #{sorted.size} files)"
38
- footer << totals[:count].to_s
39
- footer << format_bytes(totals[:bytes])
40
- footer << format("%.3f", totals[:time])
41
- table << footer
32
+ table
42
33
  end
43
- # rubocop:enable Metrics/AbcSize
44
34
 
45
35
  def header_labels
46
36
  GAUGES.map { |gauge| gauge.to_s.capitalize }.unshift("Filename")
@@ -33,18 +33,14 @@ module Jekyll
33
33
 
34
34
  def profile_process
35
35
  profile_data = { "PHASE" => "TIME" }
36
- total_time = 0
37
36
 
38
37
  [:reset, :read, :generate, :render, :cleanup, :write].each do |method|
39
38
  start_time = Time.now
40
39
  @site.send(method)
41
40
  end_time = (Time.now - start_time).round(4)
42
41
  profile_data[method.to_s.upcase] = format("%.4f", end_time)
43
- total_time += end_time
44
42
  end
45
43
 
46
- profile_data["TOTAL TIME"] = format("%.4f", total_time)
47
-
48
44
  Jekyll.logger.info "\nBuild Process Summary:"
49
45
  Jekyll.logger.info Profiler.tabulate(Array(profile_data))
50
46
 
@@ -6,7 +6,7 @@ module Jekyll
6
6
 
7
7
  def initialize(site, in_source_dir: nil)
8
8
  @site = site
9
- @content = DataHash.new
9
+ @content = {}
10
10
  @entry_filter = EntryFilter.new(site)
11
11
  @in_source_dir = in_source_dir || @site.method(:in_source_dir)
12
12
  @source_dir = @in_source_dir.call("/")
@@ -24,8 +24,6 @@ module Jekyll
24
24
  @content
25
25
  end
26
26
 
27
- # rubocop:disable Metrics/AbcSize
28
-
29
27
  # Read and parse all .yaml, .yml, .json, .csv and .tsv
30
28
  # files under <dir> and add them to the <data> variable.
31
29
  #
@@ -45,14 +43,13 @@ module Jekyll
45
43
  next if @entry_filter.symlink?(path)
46
44
 
47
45
  if File.directory?(path)
48
- read_data_to(path, data[sanitize_filename(entry)] = DataHash.new)
46
+ read_data_to(path, data[sanitize_filename(entry)] = {})
49
47
  else
50
48
  key = sanitize_filename(File.basename(entry, ".*"))
51
- data[key] = DataEntry.new(site, path, read_data_file(path))
49
+ data[key] = read_data_file(path)
52
50
  end
53
51
  end
54
52
  end
55
- # rubocop:enable Metrics/AbcSize
56
53
 
57
54
  # Determines how to read a data file.
58
55
  #
data/lib/jekyll/site.rb CHANGED
@@ -360,15 +360,9 @@ module Jekyll
360
360
  end
361
361
 
362
362
  def each_site_file
363
- seen_files = []
364
- %w(pages static_files_to_write docs_to_write).each do |type|
365
- send(type).each do |item|
366
- next if seen_files.include?(item)
367
-
368
- yield item
369
- seen_files << item
370
- end
371
- end
363
+ pages.each { |page| yield page }
364
+ static_files.each { |file| yield(file) if file.write? }
365
+ collections.each_value { |coll| coll.docs.each { |doc| yield(doc) if doc.write? } }
372
366
  end
373
367
 
374
368
  # Returns the FrontmatterDefaults or creates a new FrontmatterDefaults
data/lib/jekyll/utils.rb CHANGED
@@ -47,14 +47,7 @@ module Jekyll
47
47
  end
48
48
 
49
49
  def mergable?(value)
50
- case value
51
- when Hash, Drops::Drop, DataHash
52
- true
53
- when DataEntry
54
- mergable?(value.data)
55
- else
56
- false
57
- end
50
+ value.is_a?(Hash) || value.is_a?(Drops::Drop)
58
51
  end
59
52
 
60
53
  def duplicable?(obj)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jekyll
4
- VERSION = "4.3.0"
4
+ VERSION = "4.3.2"
5
5
  end
data/lib/jekyll.rb CHANGED
@@ -45,8 +45,6 @@ module Jekyll
45
45
  autoload :Collection, "jekyll/collection"
46
46
  autoload :Configuration, "jekyll/configuration"
47
47
  autoload :Convertible, "jekyll/convertible"
48
- autoload :DataEntry, "jekyll/data_entry"
49
- autoload :DataHash, "jekyll/data_hash"
50
48
  autoload :Deprecator, "jekyll/deprecator"
51
49
  autoload :Document, "jekyll/document"
52
50
  autoload :EntryFilter, "jekyll/entry_filter"
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  - Parker Moore
9
9
  - Matt Rogers
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-10-20 00:00:00.000000000 Z
13
+ date: 2023-01-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -268,7 +268,7 @@ files:
268
268
  - exe/jekyll
269
269
  - lib/blank_template/_config.yml
270
270
  - lib/blank_template/_layouts/default.html
271
- - lib/blank_template/_sass/main.scss
271
+ - lib/blank_template/_sass/base.scss
272
272
  - lib/blank_template/assets/css/main.scss
273
273
  - lib/blank_template/index.md
274
274
  - lib/jekyll.rb
@@ -295,8 +295,6 @@ files:
295
295
  - lib/jekyll/converters/markdown/kramdown_parser.rb
296
296
  - lib/jekyll/converters/smartypants.rb
297
297
  - lib/jekyll/convertible.rb
298
- - lib/jekyll/data_entry.rb
299
- - lib/jekyll/data_hash.rb
300
298
  - lib/jekyll/deprecator.rb
301
299
  - lib/jekyll/document.rb
302
300
  - lib/jekyll/drops/collection_drop.rb
@@ -396,7 +394,7 @@ metadata:
396
394
  bug_tracker_uri: https://github.com/jekyll/jekyll/issues
397
395
  changelog_uri: https://github.com/jekyll/jekyll/releases
398
396
  homepage_uri: https://jekyllrb.com
399
- post_install_message:
397
+ post_install_message:
400
398
  rdoc_options:
401
399
  - "--charset=UTF-8"
402
400
  require_paths:
@@ -413,7 +411,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
411
  version: 2.7.0
414
412
  requirements: []
415
413
  rubygems_version: 3.1.6
416
- signing_key:
414
+ signing_key:
417
415
  specification_version: 4
418
416
  summary: A simple, blog aware, static site generator.
419
417
  test_files: []
@@ -1,83 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Jekyll
4
- class DataEntry
5
- attr_accessor :context
6
- attr_reader :data
7
-
8
- # Create a Jekyll wrapper for given parsed data object.
9
- #
10
- # site - The current Jekyll::Site instance.
11
- # abs_path - Absolute path to the data source file.
12
- # parsed_data - Parsed representation of data source file contents.
13
- #
14
- # Returns nothing.
15
- def initialize(site, abs_path, parsed_data)
16
- @site = site
17
- @path = abs_path
18
- @data = parsed_data
19
- end
20
-
21
- # Liquid representation of current instance is the parsed data object.
22
- #
23
- # Mark as a dependency for regeneration here since every renderable object primarily uses the
24
- # parsed data object while the parent resource is being rendered by Liquid. Accessing the data
25
- # object directly via Ruby interface `#[]()` is outside the scope of regeneration.
26
- #
27
- # FIXME: Marking as dependency on every call is non-ideal. Optimize at later day.
28
- #
29
- # Returns the parsed data object.
30
- def to_liquid
31
- add_regenerator_dependencies if incremental_build?
32
- @data
33
- end
34
-
35
- # -- Overrides to maintain backwards compatibility --
36
-
37
- # Any missing method will be forwarded to the underlying data object stored in the instance
38
- # variable `@data`.
39
- def method_missing(method, *args, &block)
40
- @data.respond_to?(method) ? @data.send(method, *args, &block) : super
41
- end
42
-
43
- def respond_to_missing?(method, *)
44
- @data.respond_to?(method) || super
45
- end
46
-
47
- def <=>(other)
48
- data <=> (other.is_a?(self.class) ? other.data : other)
49
- end
50
-
51
- def ==(other)
52
- data == (other.is_a?(self.class) ? other.data : other)
53
- end
54
-
55
- # Explicitly defined to bypass re-routing from `method_missing` hook for greater performance.
56
- #
57
- # Returns string representation of parsed data object.
58
- def inspect
59
- @data.inspect
60
- end
61
-
62
- private
63
-
64
- def incremental_build?
65
- @incremental = @site.config["incremental"] if @incremental.nil?
66
- @incremental
67
- end
68
-
69
- def add_regenerator_dependencies
70
- page = context.registers[:page]
71
- return unless page&.key?("path")
72
-
73
- absolute_path = \
74
- if page["collection"]
75
- @site.in_source_dir(@site.config["collections_dir"], page["path"])
76
- else
77
- @site.in_source_dir(page["path"])
78
- end
79
-
80
- @site.regenerator.add_dependency(absolute_path, @path)
81
- end
82
- end
83
- end
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Jekyll
4
- # A class that behaves very similar to Ruby's `Hash` class yet different in how it is handled by
5
- # Liquid. This class emulates Hash by delegation instead of inheritance to minimize overridden
6
- # methods especially since some Hash methods returns another Hash instance instead of the
7
- # subclass instance.
8
- class DataHash
9
- #
10
- # Delegate given (zero-arity) method(s) to the Hash object stored in instance variable
11
- # `@registry`.
12
- # NOTE: Avoiding the use of `Forwardable` module's `def_delegators` for preventing unnecessary
13
- # creation of interim objects on multiple calls.
14
- def self.delegate_to_registry(*symbols)
15
- symbols.each { |sym| define_method(sym) { @registry.send(sym) } }
16
- end
17
- private_class_method :delegate_to_registry
18
-
19
- # -- core instance methods --
20
-
21
- attr_accessor :context
22
-
23
- def initialize
24
- @registry = {}
25
- end
26
-
27
- def [](key)
28
- @registry[key].tap do |value|
29
- value.context = context if value.respond_to?(:context=)
30
- end
31
- end
32
-
33
- # `Hash#to_liquid` returns the Hash instance itself.
34
- # Mimic that behavior by returning `self` instead of returning the `@registry` variable value.
35
- def to_liquid
36
- self
37
- end
38
-
39
- # -- supplementary instance methods to emulate Hash --
40
-
41
- delegate_to_registry :freeze, :inspect
42
-
43
- def merge(other, &block)
44
- merged_registry = @registry.merge(other, &block)
45
- dup.tap { |d| d.instance_variable_set(:@registry, merged_registry) }
46
- end
47
-
48
- def merge!(other, &block)
49
- @registry.merge!(other, &block)
50
- self
51
- end
52
-
53
- def method_missing(method, *args, &block)
54
- @registry.send(method, *args, &block)
55
- end
56
-
57
- def respond_to_missing?(method, *)
58
- @registry.respond_to?(method)
59
- end
60
- end
61
- end