Welcome to mirror list, hosted at ThFree Co, Russian Federation.

css.html « head « partials « layouts - github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee8046a6bb15003e7dc545da064c195f5c6512d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{ $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">
{{ else }}
{{ $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">
{{ end }}

<!-- Custom css -->
{{ range .Site.Params.customCSS -}}
    <link rel="stylesheet" href="{{ . | relURL }}">
{{- end }}