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 %} {% for path in config.extra_javascript %}
<script src="{{ path|url }}" defer></script> <script src="{{ path|url }}" defer></script>
{% endfor %} {% 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> </body>
</html> </html>

View File

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

View File

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

View File

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