diff options
Diffstat (limited to 'layouts/partials/head/css.html')
-rw-r--r-- | layouts/partials/head/css.html | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html index 2813437..e280aa5 100644 --- a/layouts/partials/head/css.html +++ b/layouts/partials/head/css.html @@ -1,12 +1,16 @@ <!-- Fonts and icon CSS --> <link rel="stylesheet" href="{{ "/css/font-awesome.min.css" | relURL }}"> -<link rel="stylesheet" href="{{ "/css/nunito_sans.css" | relURL }}"> -<!-- Main css --> -{{ if .Site.Params.cacheBuster }} - <link rel="stylesheet" href="{{ (printf "css/%s-style.css?t=%d" (.Site.Params.themeStyle | default "dark") now.Unix) |relURL }}"> +{{ $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 }} - <link rel="stylesheet" href="{{ (printf "css/%s-style.css" .Site.Params.themeStyle | default "dark") | relURL }}"> +{{ $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 --> |