Make css and js resources minify

This commit is contained in:
2021-08-26 10:56:49 +08:00
parent f1e4ec6217
commit 45fc1a2d56
2 changed files with 6 additions and 3 deletions

View File

@@ -23,7 +23,8 @@
{{ partial "meta-tags.html" . }}
{{ end -}}
{{ with resources.Get "css/katex.css" -}}
<link href="{{ .Permalink }}" rel="stylesheet">
{{ $katexcss := resources.Get "css/katex.css" | minify }}
<link href="{{ $katexcss.Permalink }}" rel="stylesheet">
{{ end -}}
{{ $normalizeStyle := resources.Get "css/normalize.css" }}
{{ $mainStyle := resources.Get "css/style.css" }}

View File

@@ -1,8 +1,10 @@
{{ with resources.Get "js/katex.js" }}
<script defer src="{{ .Permalink }}"></script>
{{ $katexjs := resources.Get "js/katex.js" | minify }}
<script defer src="{{ $katexjs.Permalink }}"></script>
{{ end }}
{{ with resources.Get "js/auto-render.js" }}
<script defer src="{{ .Permalink }}" onload="renderMathInElement(document.body);"></script>
{{ $autorenderjs := resources.Get "js/auto-render.js" | minify }}
<script defer src="{{ $autorenderjs.Permalink }}" onload="renderMathInElement(document.body);"></script>
{{ end }}
{{ $corejs := resources.Get "js/core.js" | minify }}
<script src="{{ $corejs.Permalink }}"></script>