Fixes `link` tag to work with static files
This commit is contained in:
parent
05445b81c7
commit
e0ce4a00f8
|
@ -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
|
||||
|
|
|
@ -637,11 +637,12 @@ title: linking
|
|||
|
||||
{% link contacts.html %}
|
||||
{% link info.md %}
|
||||
{% link /css/screen.css %}
|
||||
CONTENT
|
||||
create_post(content, {
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"read_all" => true
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"read_all" => true
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue