Browse Source

Site.full_url: if given a fully-formed URL, return it unchanged

main
Ryan Kelly 13 years ago
parent
commit
ce275eae20
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      hyde/site.py

+ 4
- 2
hyde/site.py View File

@@ -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)
return folder.is_descendant_of(self.config.media_root_path)

Loading…
Cancel
Save