Fix #482 - ToCSS
Use toCSS alias. Based upon https://gohugo.io/functions/css/sass/
This commit is contained in:
parent
a902dacd84
commit
1546e90987
1 changed files with 14 additions and 4 deletions
|
@ -22,9 +22,19 @@
|
|||
{{ end }}
|
||||
|
||||
<!-- CSS -->
|
||||
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }}
|
||||
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}">
|
||||
{{ with resources.Get "sass/main.scss" }}
|
||||
{{ $opts := dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true }}
|
||||
{{ with . | toCSS $opts }}
|
||||
{{ if hugo.IsDevelopment }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
||||
{{ else }}
|
||||
{{ with . | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ range $val := $.Site.Params.customCSS }}
|
||||
{{ if gt (len $val) 0 }}
|
||||
|
@ -74,4 +84,4 @@
|
|||
<!-- Plausible.io -->
|
||||
{{- if $.Site.Params.plausibleDataDomain }}
|
||||
<script defer data-domain="{{ .Site.Params.plausibleDataDomain }}" src="{{ .Site.Params.plausibleScriptSource }}"></script>
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue