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