@baseTemplate

jQuery(function ($) {
    $('[data-social-url]').each(function () {
        var href = $(this).attr('href') || '',
            origin = window.location.origin,
            pathname = window.location.pathname.replace(/[^\/]*$/, $(this).data('pathToRoot'));

        $(this).attr(
            'href',
            (href.replace(/\[URL]/, origin + pathname).replace('/./', '/'))
        );
    });
});
