From 316835734fb24dff514eb30a42b9e1f427b99e38 Mon Sep 17 00:00:00 2001 From: "Eli W. Hunter" <42009212+elihunter173@users.noreply.github.com> Date: Sun, 5 Jan 2020 10:55:03 -0500 Subject: [PATCH] Add custom_scss (#244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Luiz F. A. de Prá --- CONTRIBUTORS.md | 1 + layouts/_default/baseof.html | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 88057a3..09e3d8d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -51,4 +51,5 @@ - [John Schroeder](https://blog.schroedernet.software) - [Tobias Lindberg](https://tobiaslindberg.com) - [KK](https://github.com/bebound) +- [Eli W. Hunter](https://github.com/elihunter173) - [Víctor López](https://github.com/viticlick) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a1fb252..3824e2e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -66,7 +66,19 @@ {{ range .Site.Params.custom_js }} {{ end }} - + + {{ range .Site.Params.custom_scss }} + {{/* We don't change the targetPath to because it's transparent to users */}} + {{ if $.Site.IsServer }} + {{ $cssOpts := (dict "enableSourceMap" true ) }} + {{ $styles := resources.Get . | toCSS $cssOpts }} + + {{ else }} + {{ $styles := resources.Get . | toCSS | minify | fingerprint }} + + {{ end }} + {{ end }} +