diff --git a/dev/doc-versions.js b/dev/doc-versions.js index 345815c..c23ccdf 100644 --- a/dev/doc-versions.js +++ b/dev/doc-versions.js @@ -21,21 +21,39 @@ return origin + path } + function pathDir (url) { + return url.replace(/\/[^\/]+$/, '/') + } + function ensureTrailingSlash (url) { return /\/$/.test(url) ? url : url + '/' } + function ensureFullPath (url) { + return /^\//.test(url) ? window.location.origin + url : url + } + function findPkgdownLocalRoot () { // get `src` attribute of the current