Fixes `link` tag to work with static files

This commit is contained in:
Jeff Kolesky 2016-08-04 20:03:01 -07:00
parent 05445b81c7
commit e0ce4a00f8
2 changed files with 10 additions and 3 deletions

View File

@ -18,6 +18,8 @@ module Jekyll
site.each_site_file do |item|
return item.url if item.relative_path == @relative_path
# This takes care of the case for static files that have a leading /
return item.url if item.relative_path == "/#{@relative_path}"
end
raise ArgumentError, <<eos

View File

@ -637,6 +637,7 @@ title: linking
{% link contacts.html %}
{% link info.md %}
{% link /css/screen.css %}
CONTENT
create_post(content, {
"source" => source_dir,
@ -656,6 +657,10 @@ CONTENT
should "have the URL to the \"info\" item" do
assert_match(%r!/info\.html!, @result)
end
should "have the URL to the \"screen.css\" item" do
assert_match(%r!/css/screen\.css!, @result)
end
end
context "simple page with linking" do