Files
hugo-fresh/layouts/partials/css.html

18 lines
1.0 KiB
HTML
Raw Normal View History

2018-08-04 12:47:06 +02:00
{{- $inServerMode := .Site.IsServer }}
2018-08-04 14:50:46 +02:00
{{- $sass := "style.sass" }}
{{- $cssTarget := "css/style.css" }}
{{- $cssOpts := cond ($inServerMode) (dict "targetPath" $cssTarget "enableSourceMap" true) (dict "targetPath" $cssTarget "outputStyle" "compressed") }}
{{- $fontFace := replace .Site.Params.font.name " " "+" }}
{{- $fontSizes := delimit .Site.Params.font.sizes "," }}
{{- $fontUrl := printf "https://fonts.googleapis.com/css?family=%s:%s" $fontFace $fontSizes }}
2018-08-04 12:47:06 +02:00
<link rel="icon" type="image/png" href="{{ "/images/favicon.png" | absURL }}" />
2018-08-04 14:50:46 +02:00
<link href="{{ $fontUrl }}" rel="stylesheet">
2018-08-04 12:47:06 +02:00
{{- if $inServerMode }}
{{- $css := resources.Get $sass | toCSS $cssOpts }}
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}">
2018-08-04 12:47:06 +02:00
{{- else }}
{{- $css := resources.Get $sass | toCSS $cssOpts | minify | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
2018-08-04 12:47:06 +02:00
{{- end }}
<link rel="stylesheet" type="text/css" href="{{ "/css/icons.css" | absURL }}">