コード例 #1
0
ファイル: context.py プロジェクト: linmuhe/peanut
def asset(config, value):
    """Get asset file url"""
    asset_path = config.path['asset']
    rel = urljoin(asset_path, value)
    return real_url(config.site.url, rel)
コード例 #2
0
 def url(self):
     relative_url = path_to_url(self.file_path)
     if not relative_url.startswith('/'):
         relative_url = '/' + relative_url
     return real_url(configs.site.url, relative_url)
コード例 #3
0
ファイル: model.py プロジェクト: zqqf16/Peanut
 def url(self):
     relative_url = path_to_url(self.file_path)
     if not relative_url.startswith('/'):
         relative_url = '/'+relative_url
     return real_url(configs.site.url, relative_url)
コード例 #4
0
ファイル: context.py プロジェクト: witcxc/Peanut
def asset(config, value):
    """Get asset file url"""
    asset_path = config.path['asset']
    rel = urljoin(asset_path, value)
    return real_url(config.site.url, rel)