# Path: peanut/utils.py
# def to_s(value):
# def to_u(value):
# def path_to_url(path):
# def url_to_path(url):
# def url_safe(string):
# def real_url(base, url):
# def package_resource(path):
# def neighborhood(alist):
# def list_dir(path):
# def get_resource(relative_path):


from functools import partial
from datetime import datetime
from peanut.utils import urljoin, real_url
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Context for template rendering"""



# Filters

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)

def strftime(value, date_format):
    """Date formatter"""
    return datetime.strftime(value, date_format)

def abs_url(config, value):
    """Absolute url"""

# Path: peanut/utils.py
# def to_s(value):
# def to_u(value):
# def path_to_url(path):
# def url_to_path(url):
# def url_safe(string):
# def real_url(base, url):
# def package_resource(path):
# def neighborhood(alist):
# def list_dir(path):
# def get_resource(relative_path):


# Path: peanut/context.py
from functools import partial
from datetime import datetime
from peanut.utils import urljoin, real_url

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Context for template rendering"""



# Filters

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)

def strftime(value, date_format):
    """Date formatter"""
    return datetime.strftime(value, date_format)

def abs_url(config, value):
    """Absolute url"""

    return urljoin(config.site['url'], value)