From ce275eae20d90a3f8ff41f4266c9b61e61e84436 Mon Sep 17 00:00:00 2001 From: Ryan Kelly Date: Tue, 24 May 2011 10:41:01 +1000 Subject: [PATCH] Site.full_url: if given a fully-formed URL, return it unchanged --- hyde/site.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hyde/site.py b/hyde/site.py index 5a75f8d..e3a0fd3 100644 --- a/hyde/site.py +++ b/hyde/site.py @@ -4,6 +4,7 @@ Parses & holds information about the site to be generated. """ import os import fnmatch +import urlparse from hyde.exceptions import HydeException from hyde.fs import FS, File, Folder from hyde.model import Config @@ -398,7 +399,8 @@ class Site(object): Determines if the given path is media or content based on the configuration and returns the appropriate url. """ - + if urlparse.urlparse(path)[:2] != ("",""): + return path if self.is_media(path): return self.media_url( FS(path).get_relative_path( @@ -411,4 +413,4 @@ class Site(object): Given the relative path, determines if it is content or media. """ folder = self.content.source.child_folder(path) - return folder.is_descendant_of(self.config.media_root_path) \ No newline at end of file + return folder.is_descendant_of(self.config.media_root_path)