Skip to content

Commit

Permalink
fix(layout): Address deprecation of resources.ToCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
etu committed Jul 5, 2024
1 parent 89bf6d4 commit 1944ce0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,18 @@
{{ .Site.Params.extraHeadContent | safeHTML }}

<!-- SCSS -->
{{ $options := (dict "targetPath" "css/style.css"
"vars" site.Params.style
"transpiler" "dartsass"
"outputStyle" "compressed"
"enableSourceMap" (not hugo.IsProduction)
"includePaths" (slice "node_modules/myscss")) }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" media="screen">
{{ with resources.Get "scss/main.scss" }}
{{ $opts := (dict "targetPath" "css/style.css"
"vars" site.Params.style
"transpiler" "dartsass") }}
{{ with . | toCSS $opts }}
{{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}" media="screen">
{{ else }}
{{ with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="screen">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</head>

0 comments on commit 1944ce0

Please sign in to comment.