diff options
author | Eli W. Hunter <42009212+elihunter173@users.noreply.github.com> | 2020-01-05 18:55:03 +0300 |
---|---|---|
committer | Luiz F. A. de Prá <luizdepra@users.noreply.github.com> | 2020-01-05 18:55:03 +0300 |
commit | 316835734fb24dff514eb30a42b9e1f427b99e38 (patch) | |
tree | 8e9b8854477607350602e907983c125f5f0ee68e | |
parent | fa59259139e99bf70c9f6645ba9ff89a54e2e7ff (diff) |
Add custom_scss (#244)
Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
-rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 14 |
2 files changed, 14 insertions, 1 deletions
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 }} <script src="{{ . | relURL }}"></script> {{ 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 }} + <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen"> + {{ else }} + {{ $styles := resources.Get . | toCSS | minify | fingerprint }} + <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" /> + {{ end }} + {{ end }} + <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | absURL }}" sizes="32x32"> <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | absURL }}" sizes="16x16"> |