hugo-theme-introduction/layouts/partials/head/css.html

19 lines
917 B
HTML
Raw Normal View History

2018-07-26 17:34:02 +00:00
{{ $bundleRaw := resources.Get "/sass/style.sass" | resources.ExecuteAsTemplate "/css/main.tmp.css" . }}
2018-07-20 16:27:34 +00:00
2018-07-10 07:23:19 +00:00
{{ if .Site.IsServer }}
2018-07-26 17:34:02 +00:00
{{ $cssOpts := (dict "targetPath" "/css/main.css" "enableSourceMap" true ) }}
2018-07-20 16:27:34 +00:00
{{ $bundle := $bundleRaw | toCSS $cssOpts }}
<link rel="stylesheet" href="{{ $bundle.Permalink }}" media="screen">
2018-07-01 08:09:29 +00:00
{{ else }}
2018-07-26 17:34:02 +00:00
{{ $cssOpts := (dict "targetPath" "/css/main.css" ) }}
2018-07-10 07:23:19 +00:00
{{ $postCSSOpts := (dict "use" "autoprefixer" ) }}
2018-07-20 16:27:34 +00:00
{{ $bundle := $bundleRaw | toCSS $cssOpts | postCSS $postCSSOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $bundle.Permalink }}" integrity="{{ $bundle.Data.Integrity }}" crossorigin="anonymous" media="screen">
2018-07-01 08:09:29 +00:00
{{ end }}
<!-- Custom css -->
{{ range .Site.Params.customCSS -}}
2018-07-20 16:27:34 +00:00
{{ $style := resources.Get . }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" media="screen">
2018-07-01 08:09:29 +00:00
{{- end }}