Use Hugo extended for Sass/CSS (#13113)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
c133a321c7
commit
654db85168
@@ -1,5 +1,18 @@
|
||||
{{ $inServerMode := site.IsServer }}
|
||||
{{ $sass := "sass/style.sass" }}
|
||||
{{ $cssOutput := "css/style.css" }}
|
||||
{{ $devOpts := (dict "targetPath" $cssOutput "enableSourceMap" true) }}
|
||||
{{ $prodOpts := (dict "targetPath" $cssOutput "outputStyle" "compressed") }}
|
||||
{{ $cssOpts := cond $inServerMode $devOpts $prodOpts }}
|
||||
{{ $css := resources.Get $sass | resources.ExecuteAsTemplate $sass . | toCSS $cssOpts }}
|
||||
{{ if $inServerMode }}
|
||||
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
||||
{{ else }}
|
||||
{{ $prodCss := $css | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $prodCss.RelPermalink }}" integrity="{{ $prodCss.Data.Integrity }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="stylesheet" href="/css/base_fonts.css">
|
||||
<link rel="stylesheet" href="/css/styles.css">
|
||||
{{- if .Params.case_study_styles }}
|
||||
<link rel="stylesheet" href="/css/case-study-styles.css">
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user