Created
September 22, 2021 10:54
-
-
Save silenius/a349566bb88c86c3bae5da5df04e55c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function site_url() { | |
const prefix = document.body.getAttribute('data-script_name'); | |
let url = Array.prototype.slice.call(arguments); | |
url.splice(0, 0, prefix); | |
return url.join('/').replace(/\/{2,}/, '/'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment