parent
e120c255ff
commit
0eb2796a66
|
@ -187,6 +187,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
pages.sort_by!(&:name)
|
pages.sort_by!(&:name)
|
||||||
|
static_files.sort_by!(&:relative_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Read all the files in <source>/<dir>/_posts and create a new Post
|
# Read all the files in <source>/<dir>/_posts and create a new Post
|
||||||
|
@ -384,7 +385,7 @@ module Jekyll
|
||||||
"time" => time,
|
"time" => time,
|
||||||
"posts" => posts.sort { |a, b| b <=> a },
|
"posts" => posts.sort { |a, b| b <=> a },
|
||||||
"pages" => pages,
|
"pages" => pages,
|
||||||
"static_files" => static_files.sort { |a, b| a.relative_path <=> b.relative_path },
|
"static_files" => static_files,
|
||||||
"html_pages" => pages.select { |page| page.html? || page.url.end_with?("/") },
|
"html_pages" => pages.select { |page| page.html? || page.url.end_with?("/") },
|
||||||
"categories" => post_attr_hash('categories'),
|
"categories" => post_attr_hash('categories'),
|
||||||
"tags" => post_attr_hash('tags'),
|
"tags" => post_attr_hash('tags'),
|
||||||
|
|
|
@ -3,6 +3,8 @@ module Jekyll
|
||||||
# The cache of last modification times [path] -> mtime.
|
# The cache of last modification times [path] -> mtime.
|
||||||
@@mtimes = Hash.new
|
@@mtimes = Hash.new
|
||||||
|
|
||||||
|
attr_reader :relative_path
|
||||||
|
|
||||||
# Initialize a new StaticFile.
|
# Initialize a new StaticFile.
|
||||||
#
|
#
|
||||||
# site - The Site.
|
# site - The Site.
|
||||||
|
@ -15,6 +17,7 @@ module Jekyll
|
||||||
@dir = dir
|
@dir = dir
|
||||||
@name = name
|
@name = name
|
||||||
@collection = collection
|
@collection = collection
|
||||||
|
@relative_path = File.join(*[@dir, @name].compact)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns source file path.
|
# Returns source file path.
|
||||||
|
@ -22,11 +25,6 @@ module Jekyll
|
||||||
File.join(*[@base, @dir, @name].compact)
|
File.join(*[@base, @dir, @name].compact)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the source file path relative to the site source
|
|
||||||
def relative_path
|
|
||||||
@relative_path ||= File.join(*[@dir, @name].compact)
|
|
||||||
end
|
|
||||||
|
|
||||||
def extname
|
def extname
|
||||||
File.extname(path)
|
File.extname(path)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue