Skip to content

Commit

Permalink
test [docs]
Browse files Browse the repository at this point in the history
  • Loading branch information
bboonstra committed Oct 21, 2024
1 parent b6e5a88 commit bcd4420
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ document.addEventListener("DOMContentLoaded", function () {
<nav>
<button id="sidebarToggle">☰</button>
<ul>
<li><a href="Effortless/">Home</a></li>
<li><a href="/">Home</a></li>
<li><a href="/docs/">Docs</a></li>
<li><a href="https://pypi.org/project/Effortless/">PyPI</a></li>
<li><a href="https://github.com/bboonstra/Effortless">GitHub</a></li>
Expand Down Expand Up @@ -170,12 +170,13 @@ const isLocalhost =
window.location.hostname === "127.0.0.1";

function adjustLinks() {
if (!isLocalhost) return;

const baseUrl = isLocalhost ? '' : '/Effortless';
var links = document.querySelectorAll("a");
links.forEach((link) => {
var href = link.getAttribute("href");
href = href.replace("Effortless", "");
link.setAttribute("href", href);
if (href.startsWith("/") && !href.startsWith("//")) {
href = baseUrl + href;
link.setAttribute("href", href);
}
});
}

0 comments on commit bcd4420

Please sign in to comment.