Last active
September 2, 2023 02:51
-
-
Save jmooring/9f9ca79810177b0ab03d03e4d8ad2382 to your computer and use it in GitHub Desktop.
Hugo - Transpile Sass to CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with resources.Get "sass/main.scss" }} | |
{{ $opts := dict "targetPath" "css/main.css" }} | |
{{ with . | toCSS $opts }} | |
{{ if eq hugo.Environment "development" }} | |
<link rel="stylesheet" href="{{ .RelPermalink }}"> | |
{{ else }} | |
{{ with . | minify | fingerprint }} | |
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> | |
{{ end }} | |
{{ end }} | |
{{ end }} | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment