move non-blocking js to footer
All checks were successful
website-main / prod-build (push) Successful in 10s
website-main / test-build (push) Successful in 3s

This commit is contained in:
Denys Konovalov 2024-01-20 15:47:22 +01:00
parent 1658df3bc4
commit af11ad02b7
Signed by: Denys Konovalov
GPG Key ID: 0037E1B0E33BD2C9
2 changed files with 37 additions and 36 deletions

@ -67,6 +67,43 @@
<script src="{{ . | absURL }}"></script> <script src="{{ . | absURL }}"></script>
{{ end }} {{ end }}
<script src="/pagefind/pagefind-ui.js" type="text/javascript"></script>
<script>
($ => {
$(window).on('DOMContentLoaded', () => {
new PagefindUI({
element: "#search",
translations: {
placeholder: "Suchen...",
zero_results: "Leider konnten keine Ergebnisse zu [SEARCH_TERM] gefunden werden",
clear_search: "Löschen"
}
});
$('#pagefind-search').on('shown.bs.modal', () => {
$('.pagefind-ui__search-input').focus();
});
});
})(jQuery);
</script>
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.cantorgymnasium.de/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
{{ $script := resources.Get "js/script.js" | minify }} {{ $script := resources.Get "js/script.js" | minify }}
<script src="{{ $script.Permalink }}"></script> <script src="{{ $script.Permalink }}"></script>

@ -22,42 +22,6 @@
{{ end }} {{ end }}
<link href="/pagefind/pagefind-ui.css" rel="stylesheet"> <link href="/pagefind/pagefind-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-ui.js" type="text/javascript"></script>
<script>
($ => {
$(window).on('DOMContentLoaded', () => {
new PagefindUI({
element: "#search",
translations: {
placeholder: "Suchen...",
zero_results: "Leider konnten keine Ergebnisse zu [SEARCH_TERM] gefunden werden",
clear_search: "Löschen"
}
});
$('#pagefind-search').on('shown.bs.modal', () => {
$('.pagefind-ui__search-input').focus();
});
});
})(jQuery);
</script>
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.cantorgymnasium.de/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
{{ partial "opengraph" . }} {{ partial "opengraph" . }}
{{ partial "twitter" . }} {{ partial "twitter" . }}