You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
HTML
40 lines
1.3 KiB
HTML
{{ $page := . }}
|
|
|
|
<script>
|
|
function paigeResize() {
|
|
var e = document.querySelector("#paige-content");
|
|
if (!e) {
|
|
return;
|
|
}
|
|
var mw = getComputedStyle(e).maxWidth;
|
|
var w;
|
|
if (mw === "100%") {
|
|
var e = document.querySelector("#paige-root");
|
|
var s = getComputedStyle(e);
|
|
var px = parseFloat(s.paddingLeft) + parseFloat(s.paddingRight);
|
|
var bx = parseFloat(s.borderLeftWidth) + parseFloat(s.borderRightWidth);
|
|
w = e.offsetWidth - px - bx;
|
|
} else {
|
|
w = parseFloat(mw.substring(0, mw.length - 2));
|
|
}
|
|
var es = document.querySelectorAll(".paige-video");
|
|
for (var i = 0; i < es.length; i++) {
|
|
var e = es[i];
|
|
if (!e.style.height && !e.style.width) {
|
|
e.style.width = w + "px";
|
|
}
|
|
}
|
|
}
|
|
paigeResize();
|
|
addEventListener("resize", paigeResize);
|
|
</script>
|
|
{{ partial "paige/script.html" (dict "page" $page "src" "js/paige/bootstrap/bootstrap.bundle.js") }}
|
|
|
|
{{ if $page.Param "paige.math" }}
|
|
{{ partial "paige/script.html" (dict "page" $page "src" "js/paige/katex/katex.min.js") }}
|
|
{{ partial "paige/script.html" (dict "onload" "renderMathInElement(document.body);" "page" $page "src" "js/paige/katex/auto-render.min.js") }}
|
|
{{ end }}
|
|
|
|
{{ partial "paige/analytics.html" $page }}
|
|
<noscript>{{ i18n "paige_noscript" }}</noscript>
|