scss: improve the scss pipe

- Adds the fingerprint of the processed css files.

Co-Authored-by: iGor milhit <igor@milhit.ch>
dev
iGor milhit 2024-12-07 07:52:31 +01:00
parent 0c6ae76ed9
commit 83f45fefff
Signed by: igor
GPG Key ID: 692D97C3D0228A99
1 changed files with 4 additions and 4 deletions

View File

@ -18,12 +18,12 @@
"targetPath" "styles.css" "targetPath" "styles.css"
"includePaths" (slice "node_modules") "includePaths" (slice "node_modules")
) -}} ) -}}
{{- $styles := resources.Get "scss/main.scss" | toCSS $options | minify -}} {{- $styles := resources.Get "scss/main.scss" | toCSS $options | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen"> <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
{{- end }} {{- end }}
{{ $options := (dict "targetPath" "print.css" ) -}} {{ $options := (dict "targetPath" "print.css" ) -}}
{{- $print := resources.Get "css/gutenberg.css" | toCSS $options | minify -}} {{- $print := resources.Get "css/gutenberg.css" | toCSS $options | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $print.Permalink }}" media="print"> <link rel="stylesheet" href="{{ $print.Permalink }}" integrity="{{ $print.Data.Integrity }}" media="print">
{{ range .AlternativeOutputFormats }} {{ range .AlternativeOutputFormats }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end }} {{ end }}