Rubocop cleanup for lib/jekyll/page.rb
This commit is contained in:
parent
733c56a65e
commit
3a04093e51
|
@ -21,7 +21,6 @@ AllCops:
|
|||
- lib/jekyll/layout.rb
|
||||
- lib/jekyll/liquid_renderer/table.rb
|
||||
- lib/jekyll/liquid_renderer.rb
|
||||
- lib/jekyll/page.rb
|
||||
- lib/jekyll/plugin_manager.rb
|
||||
- lib/jekyll/reader.rb
|
||||
- lib/jekyll/readers/layout_reader.rb
|
||||
|
|
|
@ -9,7 +9,7 @@ module Jekyll
|
|||
|
||||
alias_method :extname, :ext
|
||||
|
||||
FORWARD_SLASH = '/'.freeze
|
||||
FORWARD_SLASH = "/".freeze
|
||||
|
||||
# Attributes for Liquid templates
|
||||
ATTRIBUTES_FOR_LIQUID = %w(
|
||||
|
@ -18,7 +18,7 @@ module Jekyll
|
|||
name
|
||||
path
|
||||
url
|
||||
)
|
||||
).freeze
|
||||
|
||||
# A set of extensions that are considered HTML or HTML-like so we
|
||||
# should not alter them, this includes .xhtml through XHTM5.
|
||||
|
@ -27,7 +27,7 @@ module Jekyll
|
|||
.html
|
||||
.xhtml
|
||||
.htm
|
||||
)
|
||||
).freeze
|
||||
|
||||
# Initialize a new Page.
|
||||
#
|
||||
|
@ -71,7 +71,7 @@ module Jekyll
|
|||
#
|
||||
# Returns the String permalink or nil if none has been set.
|
||||
def permalink
|
||||
data.nil? ? nil : data['permalink']
|
||||
data.nil? ? nil : data["permalink"]
|
||||
end
|
||||
|
||||
# The template of the permalink.
|
||||
|
@ -135,7 +135,7 @@ module Jekyll
|
|||
#
|
||||
# Returns the path to the source file
|
||||
def path
|
||||
data.fetch('path') { relative_path.sub(/\A\//, '') }
|
||||
data.fetch("path") { relative_path.sub(%r{!\A\/!}, "") }
|
||||
end
|
||||
|
||||
# The path to the page source file, relative to the site source
|
||||
|
@ -167,7 +167,7 @@ module Jekyll
|
|||
|
||||
# Returns the Boolean of whether this Page is an index file or not.
|
||||
def index?
|
||||
basename == 'index'
|
||||
basename == "index"
|
||||
end
|
||||
|
||||
def trigger_hooks(hook_name, *args)
|
||||
|
|
Loading…
Reference in New Issue