fix: fix scroll to headings & remove unnecessary scripts

This commit is contained in:
mostafaei2002 2024-05-18 12:32:27 +03:30
parent a10a198aae
commit 8b2d4a881e
4 changed files with 6 additions and 35 deletions

View File

@ -198,33 +198,5 @@
{% for path in config.extra_javascript %}
<script src="{{ path|url }}" defer></script>
{% endfor %}
<script>
var shiftWindow = function () {
scrollBy(0, -50);
};
if (location.hash) shiftWindow();
window.addEventListener("hashchange", shiftWindow);
$(".dropdown-menu").on("click touchstart", function (event) {
event.stopPropagation();
});
// Dynamically force sidenav/dropdown to no higher than browser window
$(".side-nav, .dropdown-menu").css(
"max-height",
window.innerHeight - 130
);
$(function () {
$(window).resize(function () {
$(".side-nav, .dropdown-menu").css(
"max-height",
window.innerHeight - 130
);
});
});
</script>
</body>
</html>

View File

@ -13,7 +13,4 @@ import "../../node_modules/bootstrap/js/dist/tooltip";
import "../scss/styles.scss";
const codeBlocks = document.querySelectorAll("pre code");
codeBlocks.forEach((block) => {
block.parentElement.classList.add(["prettyprint", "well"]);
});
setupPrettify();

View File

@ -105,7 +105,7 @@ pre code {
}
.body-content {
padding-top: 120px;
padding-top: 70px;
padding-bottom: 70px;
}
@ -113,6 +113,7 @@ pre code {
display: flex;
align-items: center;
justify-content: end;
gap: 8px;
}
.toclink {
@ -153,7 +154,7 @@ pre code {
}
.prettyprint {
padding: 8px;
padding: 20px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}

View File

@ -14,7 +14,8 @@ watch:
markdown_extensions:
- admonition
- toc:
anchorlink: True
# anchorlink: True
permalink: True
nav:
- Home: 'index.md'