fix: move scripts to end of page

This commit is contained in:
mostafaei2002 2024-05-14 10:56:00 +03:30
parent 4f7f4ab054
commit fb6210066f

View File

@ -127,53 +127,7 @@
</p>
</footer>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- <script async src="https://fund.django-rest-framework.org/sidebar_include.js"></script>
<script src="{{ 'js/jquery-1.8.1-min.js'|url }}"></script>
<script src="{{ 'js/prettify-1.0.js'|url }}"></script>
<script src="{{ 'js/bootstrap-2.1.1-min.js'|url }}"></script>
<script src="{{ 'js/theme.js'|url }}"></script> -->
<script>
var base_url = "{{ base_url }}";
</script>
<script src="{{ 'js/bootstrap5.bundle.js'|url }}"></script>
{% 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>
<!-- Search Modal Start -->
<div
class="modal fade"
id="mkdocs_search_modal"
@ -224,5 +178,52 @@
</div>
</div>
<!-- Modal End -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- <script async src="https://fund.django-rest-framework.org/sidebar_include.js"></script>
<script src="{{ 'js/jquery-1.8.1-min.js'|url }}"></script>
<script src="{{ 'js/prettify-1.0.js'|url }}"></script>
<script src="{{ 'js/bootstrap-2.1.1-min.js'|url }}"></script>
<script src="{{ 'js/theme.js'|url }}"></script> -->
<script>
var base_url = "{{ base_url }}";
</script>
<script src="{{ 'js/bootstrap5.bundle.js'|url }}"></script>
{% 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>