From e0ce4a00f80535d79f62fd0196fabfe8c445bef5 Mon Sep 17 00:00:00 2001 From: Jeff Kolesky Date: Thu, 4 Aug 2016 20:03:01 -0700 Subject: [PATCH] Fixes `link` tag to work with static files --- lib/jekyll/tags/link.rb | 2 ++ test/test_tags.rb | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/tags/link.rb b/lib/jekyll/tags/link.rb index 03e2e52b..a076c417 100644 --- a/lib/jekyll/tags/link.rb +++ b/lib/jekyll/tags/link.rb @@ -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, < 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