Use Hugo extended for Sass/CSS (#13113)

This commit is contained in:
Luc Perkins
2019-06-09 06:31:07 -07:00
committed by Kubernetes Prow Robot
parent c133a321c7
commit 654db85168
20 changed files with 21 additions and 74 deletions
+14 -1
View File
@@ -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 }}