parent
66e6b2f2d3
commit
4ecbeb4063
|
@ -447,6 +447,7 @@ Style/RescueModifier:
|
|||
Style/SafeNavigation:
|
||||
Exclude:
|
||||
- lib/jekyll/document.rb
|
||||
- lib/jekyll/page.rb
|
||||
Style/SignalException:
|
||||
EnforcedStyle: only_raise
|
||||
Style/SingleArgumentDig:
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -23,7 +23,7 @@ group :test do
|
|||
gem "nokogiri", "~> 1.7"
|
||||
gem "rspec"
|
||||
gem "rspec-mocks"
|
||||
gem "rubocop", "~> 1.38.0"
|
||||
gem "rubocop", "~> 1.45.0"
|
||||
gem "rubocop-minitest"
|
||||
gem "rubocop-performance"
|
||||
gem "rubocop-rake"
|
||||
|
|
|
@ -4,7 +4,9 @@ module Jekyll
|
|||
class StaticFile
|
||||
extend Forwardable
|
||||
|
||||
attr_reader :relative_path, :extname, :name
|
||||
attr_reader :relative_path, :extname,
|
||||
:type, # Returns the type of the collection if present, nil otherwise.
|
||||
:name
|
||||
|
||||
def_delegator :to_liquid, :to_json, :to_json
|
||||
|
||||
|
@ -34,6 +36,7 @@ module Jekyll
|
|||
@collection = collection
|
||||
@relative_path = File.join(*[@dir, @name].compact)
|
||||
@extname = File.extname(@name)
|
||||
@type = @collection&.label&.to_sym
|
||||
end
|
||||
# rubocop: enable Metrics/ParameterLists
|
||||
|
||||
|
@ -171,11 +174,6 @@ module Jekyll
|
|||
end
|
||||
end
|
||||
|
||||
# Returns the type of the collection if present, nil otherwise.
|
||||
def type
|
||||
@type ||= @collection.nil? ? nil : @collection.label.to_sym
|
||||
end
|
||||
|
||||
# Returns the front matter defaults defined for the file's URL and/or type
|
||||
# as defined in _config.yml.
|
||||
def defaults
|
||||
|
|
Loading…
Reference in New Issue