aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/head/styles.html
blob: e5432ad03959a6a96df9cd046a96537b576677e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

{{/* 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" 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" -}}

{{/* Output */}}
{{- if eq hugo.Environment "development" -}}
    <link rel="stylesheet" href="{{ $styles.Permalink | absURL }}" />
{{- else -}}
    {{- $styles := $styles | minify | fingerprint | resources.PostProcess -}}
    <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" />
{{- end -}}