the home site for me: also iteration 3 or 4 of my site
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

bug: fix the copy button

+5 -4
+1 -1
sass/css/_copy-button.scss
··· 55 55 ); 56 56 } 57 57 58 - &:focus { 58 + &:focus-visible { 59 59 background-color: color-mix( 60 60 in oklab, 61 61 var(--accent) 80%,
+4 -3
static/js/copy-button.js
··· 1 1 // Based on https://www.roboleary.net/2022/01/13/copy-code-to-clipboard-blog.html 2 2 3 3 function initCopyButtons() { 4 - const blocks = document.querySelectorAll("pre[class^='language-']"); 5 - 4 + const blocks = document.querySelectorAll("pre.z-code"); 5 + 6 6 for (const block of blocks) { 7 7 // Code block header title 8 8 const title = document.createElement("span"); 9 9 title.style.color = "var(--accent-text)"; 10 - const lang = block.getAttribute("data-lang"); 10 + const lang = block.querySelector("code[data-lang]")?.getAttribute("data-lang") ?? ""; 11 11 const comment = 12 12 block.previousElementSibling && 13 13 (block.previousElementSibling.tagName === "blockquote" || ··· 56 56 if (navigator.clipboard) { 57 57 try { 58 58 await navigator.clipboard.writeText(text); 59 + button.blur(); 59 60 header.classList.add("active"); 60 61 button.setAttribute("disabled", true); 61 62