def add_logo()

in pelican/plugins/asfdata.py [0:0]


def add_logo(reference, part):
    # split between logo pattern and default.
    parts = part.split(',')
    for item in reference:
        # the logo pattern includes a place to insert the project/podling key
        logo = (parts[0].format(item.key_id))
        # HEAD request
        try:
            response = requests.head('https://www.apache.org/' + logo, timeout=REQUESTS_TIMEOUT)
            if response.status_code != 200:
                # logo not found - use the default logo
                logo = parts[1]
        except requests.exceptions.Timeout:
            logo = parts[1]
        # save the logo path as an attribute
        setattr(item, 'logo', logo)
    return reference