mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 01:01:18 -04:00
feat: add filetree component for shortcode
chore: update tailwind config and move hugo_stats
This commit is contained in:
@ -60,6 +60,12 @@
|
||||
@apply my-2;
|
||||
}
|
||||
}
|
||||
.not-prose ul, ol {
|
||||
@apply m-0 list-none;
|
||||
li {
|
||||
@apply m-0;
|
||||
}
|
||||
}
|
||||
kbd {
|
||||
@apply border-black border-opacity-[0.04] bg-opacity-[0.03] bg-black break-words rounded-md border py-0.5 px-[.25em] text-[.9em] dark:border-white/10 dark:bg-white/10;
|
||||
}
|
||||
|
13
assets/js/filetree.js
Normal file
13
assets/js/filetree.js
Normal file
@ -0,0 +1,13 @@
|
||||
// Script for filetree shortcode collapsing/expanding folders used in the theme
|
||||
// ======================================================================
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const folders = document.querySelectorAll(".hextra-filetree-folder");
|
||||
folders.forEach(function (folder) {
|
||||
folder.addEventListener("click", function () {
|
||||
Array.from(folder.children).forEach(function (el) {
|
||||
el.dataset.state = el.dataset.state === "open" ? "closed" : "open";
|
||||
});
|
||||
folder.nextElementSibling.dataset.state = folder.nextElementSibling.dataset.state === "open" ? "closed" : "open";
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user