aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/head/styles.html18
1 files changed, 11 insertions, 7 deletions
diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html
index cfab45a..e5432ad 100644
--- a/layouts/partials/head/styles.html
+++ b/layouts/partials/head/styles.html
@@ -1,17 +1,21 @@
-{{/* Resources */}}
+{{/* Resources */}}
{{- $tailwind := resources.Get "css/tailwind.css" | postCSS (dict "config" "./config/postcss.config.js") -}}
{{/* MathJax */}}
-<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
-<script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });</script>
+<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" defer></script>
+<script type="text/x-mathjax-config">
+document.addEventListener('DOMContentLoaded', function () {
+ MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });
+});
+</script>
-{{/* Processor */}}
-{{- $styles := slice $tailwind | resources.Concat "css/app.css" -}}
+{{/* Processor */}}
+{{- $styles := slice $tailwind | resources.Concat "css/app.css" -}}
-{{/* Output */}}
+{{/* Output */}}
{{- if eq hugo.Environment "development" -}}
<link rel="stylesheet" href="{{ $styles.Permalink | absURL }}" />
-{{- else -}}
+{{- else -}}
{{- $styles := $styles | minify | fingerprint | resources.PostProcess -}}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" />
{{- end -}}