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

github.com/serg/yourfolio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/funcs/GetCSS.html')
-rw-r--r--layouts/partials/funcs/GetCSS.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/partials/funcs/GetCSS.html b/layouts/partials/funcs/GetCSS.html
new file mode 100644
index 0000000..bcbb7a1
--- /dev/null
+++ b/layouts/partials/funcs/GetCSS.html
@@ -0,0 +1,14 @@
+{{$isProduction := hugo.IsProduction}}
+{{$sassOptions := dict "enableSourceMap" (.enableSourceMap | default (not $isProduction))}}
+
+{{with .outputPath}}
+ {{$sassOptions = merge $sassOptions (dict "targetPath" .)}}
+{{end}}
+
+{{$css := resources.Get .sourcePath | toCSS $sassOptions}}
+
+{{if $isProduction}}
+ {{$css = $css | minify | fingerprint}}
+{{end}}
+
+{{return $css}} \ No newline at end of file