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

github.com/okkur/syna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornzt-ventures <56795811+nzt-ventures@users.noreply.github.com>2020-10-23 14:23:04 +0300
committerGitHub <noreply@github.com>2020-10-23 14:23:04 +0300
commit9577538be2aac6778fd0fdb98637b51f11d5d0f6 (patch)
treecd84ea1eb3020a3c3cad70694f20255009966df3
parentca1c4929f5cd3db0f4c856e5db90fa50fb51fc7f (diff)
parent4c436a27620f81e3e361c51a3737aa5622eac880 (diff)
Merge pull request #816 from mpourismaiel/fix/postcss/disable-postcss-default
Fix postcss issues
-rw-r--r--layouts/partials/head.html19
1 files changed, 17 insertions, 2 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index f3ab6544..f69423a1 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -52,8 +52,23 @@
{{- $sassTemplate := resources.Get "styles/index.scss" -}}
{{- $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" true "includePaths" (slice "node_modules" "styles")) -}}
{{- $styleTemplated := $sassTemplate | resources.ExecuteAsTemplate "main.scss" . -}}
- {{- $style := $styleTemplated | resources.ToCSS $options | resources.PostCSS | resources.Minify | resources.Fingerprint | resources.PostProcess }}
- <link href="{{ $style.Permalink }}" rel="stylesheet">
+ {{- if hugo.IsProduction -}}
+ {{- if .Site.Params.postcss -}}
+ {{- $style := $styleTemplated | resources.ToCSS $options | resources.PostCSS | resources.Minify | resources.Fingerprint | resources.PostProcess }}
+ <link href="{{ $style.Permalink }}" rel="stylesheet">
+ {{- else -}}
+ {{- $style := $styleTemplated | resources.ToCSS $options | resources.Minify | resources.Fingerprint }}
+ <link href="{{ $style.Permalink }}" rel="stylesheet">
+ {{- end -}}
+ {{- else -}}
+ {{- if .Site.Params.postcss -}}
+ {{- $style := $styleTemplated | resources.ToCSS $options | resources.PostCSS | resources.PostProcess }}
+ <link href="{{ $style.Permalink }}" rel="stylesheet">
+ {{- else -}}
+ {{- $style := $styleTemplated | resources.ToCSS $options }}
+ <link href="{{ $style.Permalink }}" rel="stylesheet">
+ {{- end -}}
+ {{- end -}}
{{- with .Site.Params.custom -}}
{{- with .favicon }}