INNER CODE UNIT · JavaScript

offsetRelativeUrl

mikelove/bioc-refcard · README_files/libs/quarto-html/quarto.js:200

  function offsetRelativeUrl(url) {
    const offset = getMeta("quarto:offset");
    return offset ? offset + url : url;
  }

  function offsetAbsoluteUrl(url) {
    const offset = getMeta("quarto:offset");
    const baseUrl = new URL(offset, window.location);

    const projRelativeUrl = url.replace(baseUrl, "");
    if (projRelativeUrl.startsWith("/")) {
      return projRelativeUrl;
    } else {
      return "/" + projRelativeUrl;
    }
  }

  // read a meta tag value

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…