use /assets for theme assets, not _assets
This commit is contained in:
parent
ff3df203c4
commit
c86fba6fb3
|
@ -16,25 +16,26 @@ module Jekyll
|
|||
end
|
||||
|
||||
def assets_path
|
||||
path_for "assets"
|
||||
path_for :assets
|
||||
end
|
||||
|
||||
def includes_path
|
||||
path_for "includes"
|
||||
path_for :includes
|
||||
end
|
||||
|
||||
def layouts_path
|
||||
path_for "layouts"
|
||||
path_for :layouts
|
||||
end
|
||||
|
||||
def sass_path
|
||||
path_for "sass"
|
||||
path_for :sass
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def path_for(folder)
|
||||
path = Jekyll.sanitized_path root, "_#{folder}"
|
||||
folder = "_#{folder}" unless folder == :assets
|
||||
path = Jekyll.sanitized_path root, folder.to_s
|
||||
path if Dir.exists?(path)
|
||||
end
|
||||
|
||||
|
|
|
@ -28,16 +28,20 @@ class TestTheme < JekyllUnitTest
|
|||
end
|
||||
|
||||
context "path generation" do
|
||||
["assets", "layouts", "includes", "sass"].each do |folder|
|
||||
[:assets, :layouts, :includes, :sass].each do |folder|
|
||||
should "know the #{folder} path" do
|
||||
expected = File.expand_path("_#{folder}", @expected_root)
|
||||
if folder == :assets
|
||||
expected = File.expand_path(folder.to_s, @expected_root)
|
||||
else
|
||||
expected = File.expand_path("_#{folder}", @expected_root)
|
||||
end
|
||||
assert_equal expected, @theme.public_send("#{folder}_path")
|
||||
end
|
||||
end
|
||||
|
||||
should "generate folder paths" do
|
||||
expected = File.expand_path("_assets", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, "assets")
|
||||
expected = File.expand_path("./assets", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, :assets)
|
||||
end
|
||||
|
||||
should "not allow paths outside of the theme root" do
|
||||
|
|
Loading…
Reference in New Issue