commit 0e532207ea1df6215f970ce2593f971c80e2be58
parent 07328542b53633631cc72c6f44029f5e878a6af4
Author: Christian Ermann <christianermann@gmail.com>
Date: Wed, 23 Oct 2024 15:23:07 -0700
Remove web loop
Diffstat:
4 files changed, 0 insertions(+), 58 deletions(-)
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
@@ -3,5 +3,4 @@
<a href="{{ .URL }}">{{ .Name }}</a>.
{{ end }}
<p>Copyright © {{ now.Year }} {{ .Site.Params.author }}.</p>
- <script src="{{ "/js/web-loop.js" | urlize | relURL }}"></script>
</footer>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
@@ -4,9 +4,4 @@
<a href="{{ .URL | relURL }}">{{ .Name }}</a>.
{{ end }}
</nav>
- <nav id="web-loop" site="christianermann.dev">
- <a id="main">Test Loop</a>:
- <a id="prev">Prev</a>.
- <a id="next">Next</a>.
- </nav>
</header>
diff --git a/static/css/custom.css b/static/css/custom.css
@@ -1,17 +0,0 @@
-
-header {
- padding-bottom: 20px;
-}
-
-nav {
- float: left;
-}
-
-#web-loop {
- float: right;
-}
-
-#main, #prev, #next {
- color: #24a5d4;
-}
-
diff --git a/static/js/web-loop.js b/static/js/web-loop.js
@@ -1,35 +0,0 @@
-
-const WEB_LOOP_DATA_URL = `https://raw.githubusercontent.com/c2000e/web-loops/main/test-loop.json`
-
-window.onload = function() {
-
- const webLoop = document.getElementById("web-loop");
- const thisSite = webLoop.getAttribute("site");
-
- fetch(WEB_LOOP_DATA_URL)
- .then((response) => response.json())
- .then((sites) => {
- const thisSiteIndex = sites.findIndex(
- (site) => site.name === thisSite
- );
-
- let prevSiteIndex = thisSiteIndex - 1;
- if (prevSiteIndex < 0) prevSiteIndex = sites.length - 1;
-
- let nextSiteIndex = thisSiteIndex + 1;
- if (nextSiteIndex > sites.length - 1) nextSiteIndex = 0;
-
- const mainLink = webLoop.querySelector("#main");
- const prevLink = webLoop.querySelector("#prev");
- const nextLink = webLoop.querySelector("#next");
-
- console.log(thisSiteIndex);
- console.log(prevSiteIndex);
- console.log(nextSiteIndex);
-
- mainLink.href = sites[0].url;
- prevLink.href = sites[prevSiteIndex].url;
- nextLink.href = sites[nextSiteIndex].url;
- });
-}
-