function createUrl(urlPath, absolute, secure) {
    urlPath = urlPath || '/';
    absolute = absolute || false;
    var output = '', baseUrl;

    // create base of url, always ends without a slash
    if (absolute) {
        baseUrl = (secure && ghostConfig.urlSSL) ? ghostConfig.urlSSL : ghostConfig.url;
        output += baseUrl.replace(/\/$/, '');
    } else {
        output += ghostConfig.paths.subdir;
    }

    // Remove double subdirectory
    if (urlPath.indexOf(ghostConfig.paths.subdir) === 0) {
        urlPath = urlPath.replace(ghostConfig.paths.subdir, '');
    }

    // append the path, always starts and ends with a slash
    output += urlPath;

    return output;
}
//  - a URL which always ends with a slash
a URL which always ends with a slash
a URL which always ends with a slash
function createUrl(urlPath, absolute, secure) {
    urlPath = urlPath || '/';
    absolute = absolute || false;
    var output = '', baseUrl;
    if (absolute) {
        baseUrl = (secure && ghostConfig.urlSSL) ? ghostConfig.urlSSL : ghostConfig.url;
        output += baseUrl.replace(/\/$/, '');
    } else {
        output += ghostConfig.paths.subdir;
    }
    if (urlPath.indexOf(ghostConfig.paths.subdir) === 0) {
        urlPath = urlPath.replace(ghostConfig.paths.subdir, '');
    }
    output += urlPath;
    return output;
}
function createUrl ( urlPath , absolute , secure ) { urlPath = urlPath || '/' ; absolute = absolute || false ; var output = '' , baseUrl ; if ( absolute ) { baseUrl = ( secure && ghostConfig . urlSSL ) ? ghostConfig . urlSSL : ghostConfig . url ; output += baseUrl . replace ( / \/$ / , '' ) ; } else { output += ghostConfig . paths . subdir ; } if ( urlPath . indexOf ( ghostConfig . paths . subdir ) === 0 ) { urlPath = urlPath . replace ( ghostConfig . paths . subdir , '' ) ; } output += urlPath ; return output ; }
a URL which always ends with a slash
a URL which always ends with a slash
// create base of url, always ends without a slash // Remove double subdirectory // append the path, always starts and ends with a slash