Sort the static files by relative path before sending to liquid

This commit is contained in:
Parker Moore 2014-02-19 14:02:03 -05:00
parent e3dd908d55
commit e0166682da
2 changed files with 2 additions and 2 deletions

View File

@ -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'),

View File

@ -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.