{"action":"created","issue":{"url":"https://api.github.com/repos/middleman/middleman/issues/1869","repository_url":"https://api.github.com/repos/middleman/middleman","labels_url":"https://api.github.com/repos/middleman/middleman/issues/1869/labels{/name}","comments_url":"https://api.github.com/repos/middleman/middleman/issues/1869/comments","events_url":"https://api.github.com/repos/middleman/middleman/issues/1869/events","html_url":"https://github.com/middleman/middleman/issues/1869","id":145566017,"number":1869,"title":"`link_to` not working for same-named assets when :relative_links is true","user":{"login":"balthisar","id":3053246,"avatar_url":"https://avatars.githubusercontent.com/u/3053246?v=3","gravatar_id":"","url":"https://api.github.com/users/balthisar","html_url":"https://github.com/balthisar","followers_url":"https://api.github.com/users/balthisar/followers","following_url":"https://api.github.com/users/balthisar/following{/other_user}","gists_url":"https://api.github.com/users/balthisar/gists{/gist_id}","starred_url":"https://api.github.com/users/balthisar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balthisar/subscriptions","organizations_url":"https://api.github.com/users/balthisar/orgs","repos_url":"https://api.github.com/users/balthisar/repos","events_url":"https://api.github.com/users/balthisar/events{/privacy}","received_events_url":"https://api.github.com/users/balthisar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-04T02:14:54Z","updated_at":"2016-04-04T09:20:13Z","closed_at":"2016-04-04T09:20:13Z","body":"As the title indicates, if I have this directory layout:\r\n\r\n~~~ \r\nsource/\r\n   license.html\r\n   archives/\r\n      index.html\r\n      license.html\r\n~~~\r\n\r\nWhen trying to link to `archives/license.html` from within `archives/index.html`, the `link_tag` helper returns the root level `license.html` file, e.g., in markdown (which uses the link_tag helper), `[local_license_file](license.md)` should return the relative file.\r\n\r\n_This part is really strange:_ if I delete the `archives/license.html` file, the `link_tag` helper actually returns the correct link (but of course, there's now no file there to link to).\r\n\r\nIn `link_tag` it looks like `paths.rb:url_for` is ultimately returning the wrong \"magic\" file, but strangely, only if the correct file is there.\r\n\r\nA workaround is to make sure no files have the same name, but this is kind of ugly.\r\n"},"comment":{"url":"https://api.github.com/repos/middleman/middleman/issues/comments/205208040","html_url":"https://github.com/middleman/middleman/issues/1869#issuecomment-205208040","issue_url":"https://api.github.com/repos/middleman/middleman/issues/1869","id":205208040,"user":{"login":"balthisar","id":3053246,"avatar_url":"https://avatars.githubusercontent.com/u/3053246?v=3","gravatar_id":"","url":"https://api.github.com/users/balthisar","html_url":"https://github.com/balthisar","followers_url":"https://api.github.com/users/balthisar/followers","following_url":"https://api.github.com/users/balthisar/following{/other_user}","gists_url":"https://api.github.com/users/balthisar/gists{/gist_id}","starred_url":"https://api.github.com/users/balthisar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balthisar/subscriptions","organizations_url":"https://api.github.com/users/balthisar/orgs","repos_url":"https://api.github.com/users/balthisar/repos","events_url":"https://api.github.com/users/balthisar/events{/privacy}","received_events_url":"https://api.github.com/users/balthisar/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T09:20:13Z","updated_at":"2016-04-04T09:20:13Z","body":"I'll close this. Oh, god, I feel so stupid for chasing this down all freaking day. _All_ day.\r\n\r\nPreview server didn't force a trailing slash, so I was working on the wrong bloody directory all day.\r\n"}}