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

20 lines
933 B
HTML
Raw Normal View History

2018-07-01 08:09:29 +00:00
<!-- Fonts and icon CSS -->
<link rel="stylesheet" href="{{ "/css/font-awesome.min.css" | relURL }}">
2018-07-10 07:23:19 +00:00
{{ $file := "sass/style.sass" }}
{{ if .Site.IsServer }}
{{ $cssOpts := (dict "targetPath" "styles/main.css" "enableSourceMap" true ) }}
{{ $styles := resources.Get $file | resources.ExecuteAsTemplate "style/main.tmp.css" . | toCSS $cssOpts }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">
2018-07-01 08:09:29 +00:00
{{ else }}
2018-07-10 07:23:19 +00:00
{{ $cssOpts := (dict "targetPath" "styles/main.css" ) }}
{{ $postCSSOpts := (dict "use" "autoprefixer" ) }}
{{ $styles := resources.Get $file | resources.ExecuteAsTemplate "style/main.tmp.css" . | toCSS $cssOpts | postCSS $postCSSOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
2018-07-01 08:09:29 +00:00
{{ end }}
<!-- Custom css -->
{{ range .Site.Params.customCSS -}}
<link rel="stylesheet" href="{{ . | relURL }}">
{{- end }}