mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-27 14:12:09 +00:00
Inline CSS
The main stylesheet for the sit is just 721 bytes uncompressed. I can inline it safely to shave off a request, since the headers alone are probably comparable to the size of the CSS.
This commit is contained in:
parent
2abdb82cb3
commit
55d99287b4
1 changed files with 4 additions and 3 deletions
|
@ -27,10 +27,11 @@
|
|||
{{ if not (eq $dark "off") -}}
|
||||
{{ $resources = $resources | append (resources.Get "css/dark.css" | resources.ExecuteAsTemplate "dark.css" .) -}}
|
||||
{{ end -}}
|
||||
{{ $css := $resources | resources.Concat "css/style.css" | minify | resources.Fingerprint "sha384" -}}
|
||||
{{ printf `<link rel="stylesheet" href="%s" integrity="%s">` $css.RelPermalink $css.Data.Integrity | safeHTML -}}
|
||||
{{ $css := $resources | resources.Concat "css/style.css" | minify -}}
|
||||
<!-- {{ printf `<link rel="stylesheet" href="%s" integrity="%s">` $css.RelPermalink $css.Data.Integrity | safeHTML -}} -->
|
||||
<style>{{ $css.Content | safeCSS }}</style>
|
||||
<!-- only load syntax-highlighting CSS if this page needs it -->
|
||||
{{ if .Params.highlight -}}
|
||||
{{- if .Params.highlight -}}
|
||||
{{ $css_syntax := resources.Get "/css/syntax.css" | minify | resources.Fingerprint "sha384" -}}
|
||||
{{- printf `<link rel="stylesheet" href="%s" integrity="%s">` $css_syntax.RelPermalink $css_syntax.Data.Integrity | safeHTML }}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Reference in a new issue