hugo-theme-introduction/layouts/partials/head/css.html
2018-07-20 18:27:34 +02:00

18 lines
873 B
HTML

{{ $bundleRaw := resources.Get "sass/style.sass" | resources.ExecuteAsTemplate "style/main.tmp.css" . }}
{{ if .Site.IsServer }}
{{ $cssOpts := (dict "targetPath" "styles/main.css" "enableSourceMap" true ) }}
{{ $bundle := $bundleRaw | toCSS $cssOpts }}
<link rel="stylesheet" href="{{ $bundle.Permalink }}" media="screen">
{{ else }}
{{ $cssOpts := (dict "targetPath" "styles/main.css" ) }}
{{ $postCSSOpts := (dict "use" "autoprefixer" ) }}
{{ $bundle := $bundleRaw | toCSS $cssOpts | postCSS $postCSSOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $bundle.Permalink }}" integrity="{{ $bundle.Data.Integrity }}" media="screen">
{{ end }}
<!-- Custom css -->
{{ range .Site.Params.customCSS -}}
{{ $style := resources.Get . }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" media="screen">
{{- end }}