hugo-sr2/layouts/_partials/head/css.html

22 lines
671 B
HTML
Raw Normal View History

2026-01-10 13:42:14 +00:00
{{ range resources.Match "css/*.scss" }}
{{ with resources.Get . }}
{{ $name := . }}
{{ $opts := dict
"enableSourceMap" hugo.IsDevelopment
"outputStyle" (cond hugo.IsDevelopment "expanded" "compressed")
"targetPath" (replace $name ".scss" ".css")
"transpiler" "dartsass"
"vars" site.Params.styles
}}
{{ with . | toCSS $opts }}
{{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{ else }}
{{ with . | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}