public function generateUrl($email, $size = null, $default = null)
    {
        if ($size == null) {
            $size = $this->environment->getConfig()->get(['templates', 'gravatar', 'size']);
        }

        if ($default == null) {
            $default = $this->environment->getConfig()->get(['templates', 'gravatar', 'default']);
        }

        $separator = '?';
        $link      = static::$baseUrl . md5(strtolower(trim($email)));

        if ($size) {
            $link     .= $separator . 's=' . $size;
            $separator = '&';
        }

        if ($default) {
            $link .= $separator . 'd=' . urlencode($default);
        }

        return $link;
    }