diff options
author | Victoria Drake <24644237+victoriadrake@users.noreply.github.com> | 2020-11-14 23:32:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-14 23:32:13 +0300 |
commit | 646c4a0a6f5c0be3a393ac187abe0fa829175ce9 (patch) | |
tree | a2d844ecc8efdc7e07584a246034eef028529e02 /layouts | |
parent | c7e5d8a222c7cbb6938ddf64c45484f68d2f44a6 (diff) | |
parent | 2063877a7cf9b676fb409abe09f168c005c9b8cc (diff) |
Merge pull request #98 from arthurbailao/custom-css-minify-fingerprint
minifying and fingerprinting custom css files
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/head/css.html | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html index cf5a301..62302c7 100644 --- a/layouts/partials/head/css.html +++ b/layouts/partials/head/css.html @@ -12,10 +12,18 @@ {{ end }} <!-- Custom css --> -{{ range .Site.Params.customCSS -}} -{{ $style := resources.Get . }} -<link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" media="screen"> -{{- end }} +{{ if .Site.IsServer }} + {{ range .Site.Params.customCSS -}} + {{ $style := resources.Get . }} + <link rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" media="screen"> + {{- end }} +{{ else }} + {{ range .Site.Params.customCSS -}} + {{ $style := resources.Get . }} + {{ $bundle := $style | minify | fingerprint }} + <link rel="stylesheet" href="{{ $bundle.RelPermalink }}" integrity="{{ $bundle.Data.Integrity }}" crossorigin="anonymous" media="screen"> + {{- end }} +{{ end }} <!-- PhotoSwipe --> {{ if eq .Type "gallery" }} @@ -23,4 +31,4 @@ <link rel="stylesheet" href="{{ $photoswipe | absURL }}"> {{ $defaultSkin := "css/default-skin.css" }} <link rel="stylesheet" href="{{ $defaultSkin | absURL }}"> -{{ end }}
\ No newline at end of file +{{ end }} |