2024-04-14 18:08:50 +08:00
|
|
|
<aside class="left-sidebar">
|
2024-04-15 02:38:22 +08:00
|
|
|
<details class="toc__wrapper" open>
|
2024-04-14 18:08:50 +08:00
|
|
|
<summary class="toc__heading">
|
|
|
|
Contents
|
|
|
|
</summary>
|
|
|
|
{{ content | toc | safe }}
|
|
|
|
</details>
|
|
|
|
</aside>
|
|
|
|
<script defer>
|
|
|
|
// Close article ToC accordion for small screen sizes
|
|
|
|
const tocWrapper = docucument.querySelector('.toc__wrapper');
|
|
|
|
const tocEl = docucument.querySelector('.toc');
|
|
|
|
if (window.innerWidth < 480) {
|
|
|
|
tocWrapper.removeAttribute("open");
|
|
|
|
} else {
|
|
|
|
tocWrapper.setAttribute("open", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remove the stickiness of the sidebar ToC if it is larger than screen height
|
|
|
|
function preventSidebarOverflow() {
|
|
|
|
if (document.documentElement.clientHeight < tocEl.offsetHeight + 50) {
|
|
|
|
tocEl.style.marginTop = "0";
|
|
|
|
tocEl.style.position = "static";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
preventSidebarOverflow();
|
|
|
|
</script>
|