Browse Source

Issue #51: Fixed site.full_url for media paths

main
Lakshmi Vyasarajan 13 years ago
parent
commit
a43583b1fa
2 changed files with 3 additions and 5 deletions
  1. +3
    -3
      hyde/site.py
  2. +0
    -2
      hyde/tests/test_site.py

+ 3
- 3
hyde/site.py View File

@@ -402,9 +402,9 @@ class Site(object):
if urlparse.urlparse(path)[:2] != ("",""):
return path
if self.is_media(path):
return self.media_url(
FS(path).get_relative_path(
self.config.media_root_path))
relative_path = File(path).get_relative_path(
Folder(self.config.media_root))
return self.media_url(relative_path)
else:
return self.content_url(path)



+ 0
- 2
hyde/tests/test_site.py View File

@@ -223,8 +223,6 @@ class TestSiteWithConfig(object):
path = 'media/css/site.css'
assert s.is_media(path)
full_url = s.full_url(path)
print s.config.media_root_path
print File(path).get_relative_path(s.config.media_root_path)
assert full_url == "/" + path

def test_media_url_from_resource(self):


||||||
x
 
000:0
Loading…
Cancel
Save