new homelab, rerender and migrated to homeserver
Some checks are pending
Render and Publish / build-deploy (push) Waiting to run

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-09-09 10:03:51 +02:00
commit ceedc35709
No known key found for this signature in database
29 changed files with 1638 additions and 470 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -85,6 +85,7 @@ code span.st {
code span.cf {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}
@ -193,6 +194,7 @@ code span.dv {
code span.kw {
color: #003B4F;
font-weight: bold;
font-style: inherit;
}

View file

@ -94,7 +94,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
if (link.href.indexOf("#") !== -1) {
const anchor = link.href.split("#")[1];
const heading = window.document.querySelector(
`[data-anchor-id=${anchor}]`
`[data-anchor-id="${anchor}"]`
);
if (heading) {
// Add the class
@ -134,8 +134,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
window.innerHeight + window.pageYOffset >=
window.document.body.offsetHeight
) {
// This is the no-scroll case where last section should be the active one
sectionIndex = 0;
} else {
// This finds the last section visible on screen that should be made active
sectionIndex = [...sections].reverse().findIndex((section) => {
if (section) {
return window.pageYOffset >= section.offsetTop - sectionMargin;
@ -317,6 +319,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
for (const child of el.children) {
child.style.opacity = 0;
child.style.overflow = "hidden";
child.style.pointerEvents = "none";
}
nexttick(() => {
@ -358,6 +361,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
const clone = child.cloneNode(true);
clone.style.opacity = 1;
clone.style.pointerEvents = null;
clone.style.display = null;
toggleContents.append(clone);
}
@ -432,6 +436,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
for (const child of el.children) {
child.style.opacity = 1;
child.style.overflow = null;
child.style.pointerEvents = null;
}
const placeholderEl = window.document.getElementById(
@ -739,6 +744,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
// Process the collapse state if this is an UL
if (el.tagName === "UL") {
if (tocOpenDepth === -1 && depth > 1) {
// toc-expand: false
el.classList.add("collapse");
} else if (
depth <= tocOpenDepth ||
@ -757,10 +763,9 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
};
// walk the TOC and expand / collapse any items that should be shown
if (tocEl) {
walk(tocEl, 0);
updateActiveLink();
walk(tocEl, 0);
}
// Throttle the scroll event and walk peridiocally
@ -779,6 +784,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
window.addEventListener(
"resize",
throttle(() => {
if (tocEl) {
updateActiveLink();
walk(tocEl, 0);
}
if (!isReaderMode()) {
hideOverlappedSidebars();
}

File diff suppressed because one or more lines are too long

View file

@ -5,9 +5,45 @@ const headroomChanged = new CustomEvent("quarto-hrChanged", {
composed: false,
});
const announceDismiss = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
annEl.remove();
const annId = annEl.getAttribute("data-announcement-id");
window.localStorage.setItem(`quarto-announce-${annId}`, "true");
}
};
const announceRegister = () => {
const annEl = window.document.getElementById("quarto-announcement");
if (annEl) {
const annId = annEl.getAttribute("data-announcement-id");
const isDismissed =
window.localStorage.getItem(`quarto-announce-${annId}`) || false;
if (isDismissed) {
announceDismiss();
return;
} else {
annEl.classList.remove("hidden");
}
const actionEl = annEl.querySelector(".quarto-announcement-action");
if (actionEl) {
actionEl.addEventListener("click", function (e) {
e.preventDefault();
// Hide the bar immediately
announceDismiss();
});
}
}
};
window.document.addEventListener("DOMContentLoaded", function () {
let init = false;
announceRegister();
// Manage the back to top button, if one is present.
let lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
const scrollDownBuffer = 5;

View file

@ -1275,7 +1275,11 @@ async function fuseSearch(query, fuse, fuseOptions) {
// If we don't have a subfuse and the query is long enough, go ahead
// and create a subfuse to use for subsequent queries
if (now - then > kFuseMaxWait && subSearchFuse === undefined) {
if (
now - then > kFuseMaxWait &&
subSearchFuse === undefined &&
resultsRaw.length < fuseOptions.limit
) {
subSearchTerm = query;
subSearchFuse = new window.Fuse([], kFuseIndexOptions);
resultsRaw.forEach((rr) => {