Quicker categories for documents without superdirs (#7987)
Merge pull request 7987
This commit is contained in:
parent
f7bff1c5c4
commit
6bc27f9fdf
|
@ -414,9 +414,13 @@ module Jekyll
|
|||
#
|
||||
# Returns nothing.
|
||||
def categories_from_path(special_dir)
|
||||
if relative_path.start_with?(special_dir)
|
||||
superdirs = []
|
||||
else
|
||||
superdirs = relative_path.sub(Document.superdirs_regex(special_dir), "")
|
||||
superdirs = superdirs.split(File::SEPARATOR)
|
||||
superdirs.reject! { |c| c.empty? || c == special_dir || c == basename }
|
||||
end
|
||||
|
||||
merge_data!({ "categories" => superdirs }, :source => "file path")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue