* revamp code highlighting

* replace standard Fira Code with a variable version

* change buttons arrows

* redesign code blocks

* make terminal logo more prominent

* separate terminal theme styles from terminal.css

Terminal.css styles only can change the color scheme.

* update docs and version

* remove USERS.md

* fix header pattern

* remove old prismjs shortcode

* remove old rss template

* remove old figure shortcode

* [chore] update yarn

LOL, I'm still using 1.22.x

* [chore] update package-lock.json

* fix pagination & boost meta visibility

* fix code blocks on mobile & move some parts from CSS to JS
This commit is contained in:
Radek Kozieł 2025-03-10 13:47:59 +01:00 committed by GitHub
parent c7770bc85e
commit 3f87c12098
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 4747 additions and 6686 deletions

32
assets/js/code.js Normal file
View file

@ -0,0 +1,32 @@
const blockcodes = document.querySelectorAll(".chroma code[data-lang]");
for (const bc of blockcodes) {
const parent = bc.parentElement;
const content = bc.innerText.split("\n").filter(Boolean).join("\n");
// Code title
const title = document.createElement("div");
const lang = bc.dataset.lang;
title.classList.add("code-title");
title.innerText = lang;
// Copy to clipboard
if (navigator.clipboard !== undefined) {
const cpbutton = document.createElement("button");
cpbutton.classList.add("copy-button");
cpbutton.innerText = "Copy";
cpbutton.addEventListener("click", () => {
cpbutton.innerText = "Copied";
setTimeout(() => {
cpbutton.innerText = "Copy";
}, 1000);
navigator.clipboard.writeText(content);
});
title.append(cpbutton);
}
parent.closest(".highlight").prepend(title);
}

File diff suppressed because one or more lines are too long