Merge pull request 6092
This commit is contained in:
parent
4e3b5ba5b4
commit
2ceff6ab3e
|
@ -72,7 +72,7 @@ module Jekyll
|
|||
def entries
|
||||
return [] unless exists?
|
||||
@entries ||=
|
||||
Utils.safe_glob(collection_dir, ["**", "*"]).map do |entry|
|
||||
Utils.safe_glob(collection_dir, ["**", "*"], File::FNM_DOTMATCH).map do |entry|
|
||||
entry["#{collection_dir}/"] = ""
|
||||
entry
|
||||
end
|
||||
|
|
|
@ -36,7 +36,8 @@ module Jekyll
|
|||
end
|
||||
|
||||
def included?(entry)
|
||||
glob_include?(site.include, entry)
|
||||
glob_include?(site.include, entry) ||
|
||||
glob_include?(site.include, File.basename(entry))
|
||||
end
|
||||
|
||||
def special?(entry)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
I should be copied
|
|
@ -0,0 +1 @@
|
|||
I should be copied
|
|
@ -222,4 +222,33 @@ class TestCollections < JekyllUnitTest
|
|||
)
|
||||
end
|
||||
end
|
||||
|
||||
context "a collection with included dotfiles" do
|
||||
setup do
|
||||
@site = fixture_site({
|
||||
"collections" => {
|
||||
"methods" => {
|
||||
"permalink" => "/awesome/:path/",
|
||||
},
|
||||
},
|
||||
"include" => %w(.htaccess .gitignore),
|
||||
})
|
||||
@site.process
|
||||
@collection = @site.collections["methods"]
|
||||
end
|
||||
|
||||
should "contain .htaccess file" do
|
||||
assert(@collection.files.any? { |d| d.name == ".htaccess" })
|
||||
end
|
||||
|
||||
should "contain .gitignore file" do
|
||||
assert(@collection.files.any? { |d| d.name == ".gitignore" })
|
||||
end
|
||||
|
||||
should "have custom URL in static file" do
|
||||
assert(
|
||||
@collection.files.any? { |d| d.url.include?("/awesome/with.dots/") }
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue