Add wiki
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
addEventListener('DOMContentLoaded', () => {
|
||||
const fullpath = location.origin + location.pathname.replace(/\/$/, "");
|
||||
|
||||
document.querySelectorAll('nav a').forEach((el) => {
|
||||
const url = new URL(el.href);
|
||||
const fullurl = url.origin + url.pathname.replace(/\/$/, "");
|
||||
console.log("fullurl", fullurl);
|
||||
console.log("fullpath", fullpath);
|
||||
console.log("locationpathname", location.pathname);
|
||||
console.log("urlpathname", url.pathname);
|
||||
const onHome = fullpath === location.origin
|
||||
const urlIsHome = fullurl === location.origin
|
||||
console.log("onhome", onHome);
|
||||
console.log("urlIsHome", urlIsHome);
|
||||
console.log("")
|
||||
|
||||
if (onHome && fullurl === fullpath) {
|
||||
el.classList.add('active');
|
||||
}
|
||||
// The startsWith is for subpages
|
||||
else if (!urlIsHome && fullpath.startsWith(fullurl)) {
|
||||
el.classList.add('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
+19
-4
@@ -85,10 +85,6 @@ nav a.active {
|
||||
color: #faf8e4 !important;
|
||||
}
|
||||
|
||||
a code {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
|
||||
footer {
|
||||
height: 2rem;
|
||||
position: absolute;
|
||||
@@ -140,6 +136,25 @@ a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
a code {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
|
||||
strong a {
|
||||
text-decoration-line: underline;
|
||||
color: var(--fg0);
|
||||
}
|
||||
|
||||
strong a:hover {
|
||||
text-decoration-line: underline;
|
||||
color: var(--fg0);
|
||||
}
|
||||
|
||||
strong a:visited {
|
||||
text-decoration-line: underline;
|
||||
color: var(--fg0);
|
||||
}
|
||||
|
||||
*::-moz-selection {
|
||||
/* background: var(--ltred); */
|
||||
background: rgba(255, 255, 0, 0.3);
|
||||
|
||||
@@ -36,18 +36,7 @@
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
addEventListener('DOMContentLoaded', () => {
|
||||
const fullpath = location.origin + location.pathname
|
||||
|
||||
document.querySelectorAll('nav a').forEach((el) => {
|
||||
const url = new URL(el.href)
|
||||
if (url.origin + url.pathname === fullpath) {
|
||||
el.classList.add('active')
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<script src="/docs/pandoc/script.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -61,6 +50,7 @@
|
||||
<div class="content">
|
||||
<a href="/">Home</a>
|
||||
<a href="/options.html">Options</a>
|
||||
<a href="/wiki">Wiki</a>
|
||||
<a href="https://github.com/rasmus-kirk/nixarr">Github</a>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -100,9 +90,6 @@
|
||||
</div>
|
||||
<footer>
|
||||
<div class="content">
|
||||
<div>
|
||||
Rasmus Kirk Jakobsen
|
||||
</div>
|
||||
$if(date)$
|
||||
<div>$date$</div>
|
||||
$endif$
|
||||
|
||||
Reference in New Issue
Block a user