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|
|
site.each_site_file do |item|
|
||||||
return item.url if item.relative_path == @relative_path
|
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
|
end
|
||||||
|
|
||||||
raise ArgumentError, <<eos
|
raise ArgumentError, <<eos
|
||||||
|
|
|
@ -637,6 +637,7 @@ title: linking
|
||||||
|
|
||||||
{% link contacts.html %}
|
{% link contacts.html %}
|
||||||
{% link info.md %}
|
{% link info.md %}
|
||||||
|
{% link /css/screen.css %}
|
||||||
CONTENT
|
CONTENT
|
||||||
create_post(content, {
|
create_post(content, {
|
||||||
"source" => source_dir,
|
"source" => source_dir,
|
||||||
|
@ -656,6 +657,10 @@ CONTENT
|
||||||
should "have the URL to the \"info\" item" do
|
should "have the URL to the \"info\" item" do
|
||||||
assert_match(%r!/info\.html!, @result)
|
assert_match(%r!/info\.html!, @result)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "have the URL to the \"screen.css\" item" do
|
||||||
|
assert_match(%r!/css/screen\.css!, @result)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "simple page with linking" do
|
context "simple page with linking" do
|
||||||
|
|
Loading…
Reference in New Issue