Sort the static files by relative path before sending to liquid
This commit is contained in:
parent
e3dd908d55
commit
e0166682da
|
@ -310,7 +310,7 @@ module Jekyll
|
|||
"time" => self.time,
|
||||
"posts" => self.posts.sort { |a, b| b <=> a },
|
||||
"pages" => self.pages,
|
||||
"static_files" => self.static_files,
|
||||
"static_files" => self.static_files.sort { |a, b| a.relative_path <=> b.relative_path },
|
||||
"html_pages" => self.pages.reject { |page| !page.html? },
|
||||
"categories" => post_attr_hash('categories'),
|
||||
"tags" => post_attr_hash('tags'),
|
||||
|
|
|
@ -23,7 +23,7 @@ module Jekyll
|
|||
|
||||
# Returns the source file path relative to the site source
|
||||
def relative_path
|
||||
path.sub(/\A#{@site.source}/, '')
|
||||
@relative_path ||= path.sub(/\A#{@site.source}/, '')
|
||||
end
|
||||
|
||||
# Obtain destination path.
|
||||
|
|
Loading…
Reference in New Issue